Dynamically cancel ControlEvent in InstallShield - installshield

I'm using InstallShield 2013 SP1. In a dialog, I have the following ControlEvents on the Next PushButton:
Event | Argument | Condition
__________|________________|___________________________
NewDialog | CustomSetup | CANCEL_NAVIGATION <> "1"
DoAction | MyCustomAction | _IsSetupTypeMin = "Custom"
The idea is that MyCustomAction does its thing, and then sets the property CANCEL_NAVIGATION to 1 if the NewDialog event should be canceled. However, the conditions are evaluated before the custom action is executed, so even if the CANCEL_NAVIGATION is set, the new dialog is spawned anyway.
If it's not possible to evaluate the condition afterwards, or circumvent this behavior in any way, some other solution, such as executing another custom action in the next dialog evaluating the property and relaunching the first dialog.
Disabling the Next button is not an option, as the behavior of my dialog is to launch a file selection window when Next is pressed (if certain conditions are met), and only if this dialog is canceled, so should the navigation to the next window.
I have considered adding a button to the dialog launching the file selection dialog instead, but this answer will not be accepted, as I would much prefer the described behavior to remain intact.

As it turns out, I had misunderstood the ordering of the ControlEvents. For some reason, I thought they were evaluated from bottom to top, since my DoAction was evaluated even though a NewDialog was configured above. Switching the lines fixed my problem:
Event | Argument | Condition
__________|________________|___________________________
DoAction | MyCustomAction | _IsSetupTypeMin = "Custom"
NewDialog | CustomSetup | CANCEL_NAVIGATION <> "1"

Related

MFC, SDI app, Why the layout of views cannot be changed via code?

I'm new to MFC. I have just created an SDI application with the wizard, then tried to modify the generated code to control the layout of each view, toolbar, or menu:
...
m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC)
...
DockPane(&m_wndToolBar); // m_wndToolBar is a tool bar
...
DockPane(&m_wndFileView);
m_wndClassView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
DockPane(&m_wndOutput);
// w_wndFileView, m_wndClassView, m_wndOutput are some views.
...
But it seems that it doesn't work: the windows always behave like they remember what the user operated at last time. For example, the last 3 lines of codes creates 3 views like this:
I run the code and closed, then modified them to:
DockPane(&m_wndFileView);
DockPane(&m_wndOutput);
m_wndClassView.AttachToTabWnd(&m_wndOutput, DM_SHOW, TRUE, &pTabbedBar);
I suppose it should appear like this but failed (This screenshot is not the run result, I changed the layout manually):
It keeps the layout as last time when closed (as picture 1). Additionally, any user's manual change of layout can remembered. So, why? Who said to do so?
By default, MFC SDI (and MDI) applications 'remember' the frame, menu and side-pane configurations between runs of the same application, which is achieved by writing/reading entries to/from the Windows Registry. Typically, for an application generated by the Visual Studio wizard, called "MySDIApp", this information will be located in a registry key named something like1:
HKEY_CURRENT_USER\SOFTWARE\Local AppWizard-Generated Applications\MySDIApp
In this, there will be a sub-key called "Workspace" and that will have numerous sub-entries, with names of the form "Pane-0123", "MFCToolBar-456", and so forth. To 'clear' all these remembered settings, you can simply delete that "Workspace" key using the registry editor.
Alternatively, you can delete that key programmatically, by adding code like the following in your application class override of the OnInitInstance member (the code should be inserted between the wizard-generated lines indicated):
BOOL CMySDIApp::InitInstance()
{
// Other wizard-generated and user code ...
SetRegistryKey(_T("Local AppWizard-Generated Applications")); // Wizard-generated
// Delete the remembered Workspace settings ...
HKEY sk;
CString kn;
kn.Format(L"SOFTWARE\\%s\\%s", m_pszRegistryKey, m_pszAppName);
if (RegOpenKeyEx(HKEY_CURRENT_USER, kn, 0, KEY_ALL_ACCESS, &sk) == ERROR_SUCCESS) {
SHDeleteKey(sk, L"WorkSpace");
RegCloseKey(sk);
}
LoadStdProfileSettings(4); // Wizard-generated
// More wizard-generated and user code ...
return TRUE;
}
1 You can find the actual registry key by using the registry editor and searching for an entry named "BasePane--1"; this appears to be the first sub-key of the "Workspace" entry for wizard-generated (and other) MFC applications.

Cucumber Scenario Outline - Execution Flow

I am working with Cucumber and Groovy in Katalon Studio. I have the cucumber feature file where it has Multiple Scenario Outlines as mentioned below.
When I run the cucumber feature file, it should run the TestCase1 of first section in the scenario outline along with the steps and TestCase1 of second section in scenario outline.
But, it is running the first section of feature file TestCase1 and TestCase2 first. That means it is just loggining with given credentials and closing the browser.
For reference, below mentioned the step definition code also.
Cucumber Feature File:
#Login1
Feature: Title of your feature
I want to use this template for my feature file
#Login1 `**SECTION ONE**`
Scenario Outline: Login into GMP Application
Given running indicator flag
And User is on GMP Application Login Screen
When User enters the in the Login
And User enters the in the password
And User clicks on the ok button
Then User logged in successful at Home Screen
Examples:
| atid | pwd1 | runind | -> Header
| nm1013 | test01g | Y | -> TestCase1
| nm0313 | test02g | Y | -> TestCase2
#Login1 `**SECTION TWO**`
Scenario Outline: Click on the Create Inquiry Menu Item
Given User is on GMP Home Screen
When user click on the Inquiry menu item
And select the billing mode should be
And user click create inquiry item from the heading
Then it should displays create inquiry pagef
Examples:
| contract | -> Header
| GS00T07NSD0007 | -> TestCase1
| GS00T07NSD0007 | -> TestCase2
Step Definition
#Given(“running indicator flag (.*)”)
def run_indicator_flag(String ind1) {
println "Passing Indicator " + ind1
}
#And(“User is on GMP Application Login Screen”)
def user_on_GMP_Application_Login_Screen() {
boolean store2a
WebUI.openBrowser(’’)
WebUI.navigateToUrl(‘https://URL’, FailureHandling.STOP_ON_FAILURE)
}
#When(“User enters the (.*) in the Login”)
def user_enter_userid_in_the_Login(String uid) {
WebUI.setText(findTestObject(‘Object Repository/ORTC01/Page_/input_userid’),
uid, FailureHandling.STOP_ON_FAILURE)
}
#And(“User enters the (.*) in the password”)
def User_enters_the_in_the_password(String pwd5) {
WebUI.setText(findTestObject(‘Object
Repository/ORTC01/Page_/input_password’), pwd5,
FailureHandling.STOP_ON_FAILURE)
}
First of all you cannot connect scenarios in Cucumber. Each scenario is a separate test that starts from nothing, does something and then resets back to nothing.
Secondly a scenario outline is just a way to write several scenarios in a more compact form. Each set of examples in an outline causes a single scenario to be created and run. I would strongly recommend you avoid using Scenario Outlines
Good scenarios describe WHAT is being done without getting into HOW things are done. Your scenarios are full of HOW things are done which makes them complex and very difficult to work with. You should push all the HOW down into your step definitions (or better still helper methods called by your step definitions.
If you do these things you will be able to write scenarios that will look something like
Scenario: Create a billing enquiry
Given I have a bill
And I am logged in
When I enquire about my bill
Then ...
Note: How the above scenario is much shorter and has no detail about HOW you do anything.

ListPicker selection changed issue in Windows Phone

I have binded listpicker in OnNavigatedTo event,
and I have an event of "listPickerSelectionChanged", but problem is that even I have not selected the item from listPicker, the "listPickerSelectionChanged" event called and error occurs, how to prevent it?
Check whether you have set the SelectedIndex value to 0 it triggers the Selection changed event even before the Databinding, So as no data is avilable at the 0th index it throws error
If set to 0 change it to -1 ,
If not please specify the error being thrown
"Object Reference not set to an instance of Object" , Some value it captured null at the time of execution, without code reference can't get into any solution
Debugging may help you out.

Multiple button form cause invalid arguments error

I want to add another button to a working monadic get form, which triggers a different processing of the entire form (like preview and submit buttons commonly found in forum post forms).
So I tried to follow the advice from this answer to this older question:
First, adding another named input button:
<input type="submit" name="preview" value="Preview">
Second, adding a call to runInputGet:
((res,widget),enc) <- runFormGet myform
isPreview <- runInputGet $ iopt boolField "preview"
... -- pre-processing the form input, i.e. basic error checks
case (isPreview,res') of
(Just True, Just checkedRes) -> ... -- preview processing
( _ , Just checkedRes) -> ... -- proper processing
Unfortunately, it does not work: whenever I press my new button, I get an invalid arguments page, saying that there is an invalid boolean with the name attached to the second submit button.
A difference to the earlier question is, that I am using a GET form instead of a POST from. However, it appears to me that I need to include the boolean field in the original form, but adding an optional boolean field with the same name in the original monadic form does not change anything at all:
_ <- mopt boolField ((String.fromString "preview") { fsName = "preview" }) Nothing
(I do not know what to do with the result from this mopt, as I neither need the view (no additional form field should be shown to the user) nor the result (since this is what the additional runInputGet already provides for))
If you look at the code for boolField, you'll see that it has a strict requirement for the format that the value is supposed to be in. Instead, you probably want to use textField- which accepts anything- and then simply test if the value was present.

How can I access button group members within a slot?

I have designed my current GUI with QT Designer. The underlying code creates and starts multiple threads. For each thread I have a set up several QPushButtons: Start, Stop, Pause, Resume, and Status. I'd like to group them, but they are not exclusive, so I need to set the enabled attribute from the signaled slot, for each related button, depending on which button has been clicked. I've tried creating a QButtonGroup for each set of buttons. I can get the sender(), but don't see how to get access to the other buttons which belong to the group. Have tried several things, but having no luck.
OK, I think I have what I need on this. The problem was how to I set the enabled states of buttons in a group based on the identity of the sender?
I have a possible x number of threads that can be controlled. The objectNames of the buttons in each QButtonGroup are as follows:
pushButton_start_x
pushButton_stop_x
pushButton_status_x
pushButton_pause_x
pushButton_resume_x
In my Python code I have the following dictionary:
# Each key represents a button type that requires setting the group's
# buttons enabled state
# Each key's values map to these buttons: [start,stop,status,pause,resume]
testManagerButtonEnableStates = {}
testManagerButtonEnableStates["start"] = [False,True,True,True,False]
testManagerButtonEnableStates["stop"] = [True,False,True,False,False]
testManagerButtonEnableStates["pause"] = [False,False,True,False,True]
testManagerButtonEnableStates["resume"] = [False,True,True,True,False]
This routine sets the states based on the objectName of the sender:
# Note that the status button does not require any action here
def setButtonGroupEnabledStates(self):
buttonType = str(self.sender().objectName().toAscii()).split('_')[1]
if buttonType == "status":
return
i = 0
for button in self.sender().group().buttons():
button.setEnabled(self.testManagerButtonEnableStates[buttonType][i])
i+=1
Maybe not the most efficient, but it gets me there...

Resources