v.8.4.1.1 .net Unexpected crashing of the program caused by frequent checking of the check boxes in the Print Preview Window - lightningchart

Flow:
User program call the PrintPreview() method: PrintPreview("User header", "", false);
User access the PrintPreview Page
Unexpected crashing(System.ArgumentException) of the program appears when:
Case 1. Check the checkbox "Use background fill"
Case 2. Frequent checking of the preview checkbox options in the "Content" region
Keep aspect ratio
Use background fill
Use graph fill
Double resolution
Checkbox options in the PrintPreview Page
Any possible solutions? Many thanks.

Related

Xamarin Forms - point to label which became visible

Is there a feature in Xamarin Forms which will point to (scroll up) to a label which became visible after validation? What I am trying to do is: if required field is blank I display label under it - saying that it needs to be filled out, I have a scrollable page and when label becomes visible I want to make it show that label by scrolling the page to desired location, so user will know what is missing.
Thank you.
You have two distinct points to implement:
first, your entry validation: there are many ways to do it, but you can take a look at this fully documented sample from Xamarin: Entry validation sample
Then next, you have to scroll to the (first) invalid entry control. That means that all your entries must be embedded into a parent Scrollview control. Then you have to find the first invalid UI element to scroll to (make your own "business" method to find this control).
Then just call the Scrollview scroll method. An example sample code could be:
// in your xaml.cs
//
public Task FocusInvalidEntryAsync()
{
var firstInvalidEntry = FindInvalidEntries().FirstOrDefault();
if(firstInvalidEntry != null)
{
return parentScrollView.ScrollToAsync(firstInvalidEntry, ScrollToPosition.MakeVisible, true);
}
return Task.FromResult(true);
}
The FindInvalidEntries() method is your own method to determine wich UI entry is invalid (maybe it needs your ViewModel).
Then ScrolltoAsync() is a method that will scroll the parent scrollview to the desired control. The last parameter indicates if you want to display the scroll animation.
Tell me if it's clear !

Unable to find control

I want to find and click a button using Autoit. I tried AutoIt Window Information Tool but the button is not recognized so ControlClick() fails.
The button is active on the current window but Send("Enter") does not work. Tried using MouseClick() but the window does not appear in the same place every time, and I tried this script:
$hWnd = WinWait("vcredist_x86")
WinWaitActive("vcredist_x86")
ControlClick($hWnd, "", "[CLASS FROM AUTOITINFO]", "Left", 1)
but neither of them works. Is there any other way to identify and click the button?
If both version of AutoItWindowInfo(32 and 64bit) don't "see" the control you need to automate, here is what you can do:
Method 1 - Sending keystrokes:
Activate the window with WindowActivate
Send a number of TABs until the control is focused(if its not initially)
Send ENTER or SPACE
Method 2 - MouseClick:
Activate the window
Get the coordinates of a control relative to the application window(position the window at 0,0. Open Autoit Window Info, click on Mouse tab and get the position of the button). That position is usually always the same
When your code is running it must get the window position with WinGetPos and then add control position you got in step 2. That's your clicking position.
Method 3 - PixelSearch(If the control has unique color):
Get the desired color with AutoIt Window Info(mouse tab)
Search it using PixelSearch
Click the coords you got
Method 4 - ImageSearch:
Get ImageSearch UDF and DLL
Make a picture of the button
Search and click it
NOTE: Sometimes you need to give your script Admin rights in order to automate certain windows.
When AutoIt Window Information Tool failed me I had success using the text property of the button/ui control:
ControlClick($hwin, '', '[CLASS:Button; TEXT:Cancel]')
Experiment with "&" in front of one of the characters (underlined by Windows to indicate an Alt + key shortcut), so try "&Cancel" instead of "Cancel". If that fails try ControlFocus() first:
ControlFocus($hwin, '', '[CLASS:Button; TEXT:Cancel]')
ControlClick($hwin, '', '[CLASS:Button; TEXT:Cancel]')
Inspecting .exe files for GUI resources (using Resource Hacker for example) may expose text/properties of a control. Example:

ASP.Net MVC make Html.DropDownList unselectable

I would like display some Html.DropDownList controls in custom readonly mode.
Control should be able to open underlaying popup but it shouldn't save values that selected by user.
For example I have Html.DropDownList control with three values:
Value 1
Value 2
Value 3
Selected item for control "Value 2"
User see combobox control with displayed item "Value 2".
When user click on control popup with all three values should be opened (as for usual combobox control). In case user choose value different from "Value 2" selected value shouldn't be saved in control. So, when user click on item "Value 3" from underlying list, control should still display item "Value 2" as selected
Is it possible in any way?
Thank you
Ugh. As a user of your system, I will not like what you have created here! The first time I try to click on Value 3, and it pops back to Value 2 without any warning, I will assume that I mis-clicked, and I will immediately try again. Hopefully I will realize that you are re-setting that dropdown list, but I won't get it right away, and I'll be annoyed.
Here's a better UI choice: Disable the invalid OPTION tags so that I can see them in the dropdown, but I can't select them. Here's the jQuery for it:
$(function () {
$("#select[name=test] option").not(":selected").attr("disabled", true);
});
I learned from an experienced programmer (not even a 'real' design guy), that the biggest sin of UI design is allowing the user to select an invalid option. Do everything in your power to avoid have to 'correct' what the user picked. By allowing them to select an invalid option, and then un-doing it instantly with JavaScript without any user feedback, you are violating this guideline.
If you are ok. with using jQuery. This should work for you.
(function () {
var previous;
// Grab the initial value in focus event.
$("select[name=test]").focus(function () {
previous = this.value;
// On change event, use previous to set the value of dropdown.
}).change(function() {
$("select[name=test]").val(previous);
});
})();​
Here is the working example.
Inspired by another StackOverflow answer.

Adobe Flex 4: Alert Title shows localized Asian Language correctly, but the Alert message does not

I'm creating an alert popup within an Adobe Flex 4 project using the following:
Alert.show(resourceManager.getString('myresource', 'ErrorMessage'), resourceManager.getString('myResource', 'ErrorMessageTitle'), Alert.OK|Alert.CANCEL,this,onExitSuccess,null,Alert.CANCEL);
When my language is of Asian origin (Japanese, Korean, Chinese, etc) the title appears correctly on the Alert, but the message does not. I'm seeing the correct localization values EVERYWHERE ELSE in my application except the Alert popup and in one other instance on a mx:Checkbox control.
I've checked my app and the strings are being returned from the resourceManager correctly but just aren't rendering to the screen. Does anyone have any insight as to what might be causing this behavior?
I suppose you just missed right bracket in the first of getString calls:
Alert.show(resourceManager.getString('myresource', 'ErrorMessage'), resourceManager.getString('myResource', 'ErrorMessageTitle'), Alert.OK|Alert.CANCEL,this,onExitSuccess,null,Alert.CANCEL);
Update:
Ok as far as there is no typo in question I suppose the problem is in font embedding. Try to set the same font style for alert body as in alert title and check the result.

Error / Validation / ToolTips in Adobe Flex

Is there any code or custom options available to achieve the following :
1> When an error occurs in a text box, the validation shows the error. Forces the user to remove the error and only then proceed to complete remaining text inputs. KEEPS the mouse focus on the Text Box.
I have used built in mx:Validator tags, but it does not coerce the user to remove the error. Instead, user can easily go ahead without rectifying the error.
2> Can the error message which generally appears as a tooltip when mouse focus moves over the text input with the error, REMAIN until the user removes error and not just be displayed on mouse hover action?
You can customize your ToolTips to show your Error. Check this link to customize your tooltip, to show your error in ToolTips
For #2, check out http://aralbalkan.com/1125.
Unfortunately, it is a lot of hassle if you have multiple/large forms. It is unfortunate flex doesn't provide more styling options for the error tooltip.
#1 seems to be a bad UI design. While you may not allow them to submit a form unless they enter valid information, they should be able to navigate around the form freely and fill in the information as they choose. Just my opinion.
A solution to question 1) is as follows;
Use the Validator.validateAll static method to check that all form items are valid before allowing the form to be submitted. The following snippet is taken from a good flex example which shows this
private function resetForm() :void
{
btnLogin.enabled = false;
}
private function validateUs() :void
{
btnLogin.enabled = (Validator.validateAll([val1,val2]).length == 0);
}
The complete example is here
http://idletogether.com/easy-form-validation-and-submit-button-enable-disable-in-flex-3/

Resources