CheckDlgButton with CComboBox - winapi

I though CheckDlgButton can only used with radio button (BS_RADIOBUTTON) or checkbox (BS_AUTOCHECKBOX).
But based on what I witness in a project that I need to maintain, it seems CheckDlgButton can be used with CComboBox.
Let's say I define a CComboBox such as following:
COMBOBOX IDC_NAME_LST,284,283,55,55,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
Then I call CheckDlgButton on it as following:
CheckDlgButton(IDC_NAME_LST,state);
I tried to set state to BST_CHECKED, BST_INDETERMINATE and BST_UNCHECKED alternatively but nothing happened.
I want to know if it is common to use CheckDlgButton with something else rather than radio button or checkbox.

Related

Replace custom menu with Oracle Forms 11g default menu

In my main form window, I have the following menu bar which is used for traversing. Its inherited from .mmb file.
Now, when I select any form on the menu, lets suppose I selected the highlighted "Purchase Order", then I don't want the same menu to be shown. I want the Oracle Form 11g's default menu to be shown instead, picture added below for reference.
I changed form's property of Inherit menu to No and the menu from image 1 isn't shown in "Purchase Order" but I still am not getting the default&smartbar menu.
How can I achieve that?
Thank you.
So I figured out a way how to disable .mmx menu and enable DEFAULT&SMARTBAR menu when I go to another form through the menu.
From the first screenshot above, the on-click-trigger had the following code
call_form(:global.path||'pc');
I replaced it with
call_form(:global.path||'pc',hide,do_replace);
So the addition of
,hide,do_replace
worked.
Side note: Also, make sure Inherit Menu property of Window property is "YES" and Menu Module of form property is set to "DEFAULT&SMARTBAR"
I think in the properties window from the form you got the property "menu module"
If you make a new form it gets the default: DEFAULT&SMARTBAR
So I think it is now filled with your mmb filename.

jQuery Validate - add class to another element apart from the one being validated

I have a textfield that needs validation and is placed next to the submit button as if to form one unique element visually. Something like this:
___________________________
| | |\ |
|______________________|_|/_|
^text part here ^badly drawn arrow here (submit button)
now, if the password is not valid (less than 5 characters) I've set up the script to make the textfields border red. What I also need though due to this design is to add a class to the submit button too so I can make it's border red also.
Any clues on how should I go about doing that?
EDIT: Or if there is a way to add a class to an ancestor element instead so I can go higher and include the submit button as well.
did it using the highlight and unhighlight properties.
http://docs.jquery.com/Plugins/Validation/validate

how to set the default button in a TaskDialog?

I am using TaskDialog API in a win32 app. I created a Task Dialog with YES/NO buttons but I can't find any option to set the No button as default. YES button is always the default. Please let me know if there is a way to set the NO button as default. I know TaskDialogIndirect supports a default button option but its an overkill for what i am trying to do. I just want a simple YES/NO Dialog with NO button as default. I did not want to use the MessageBox API because i don't want a close button in the titlebar.
Thanks,
Abhinay
Given:
TASKDIALOGCONFIG tc;
Set the default button by setting the nDefaultButton member, e.g.:
tc.nDefaultButton = ...;
"This may be any of the values specified in nButtonID members of one of the TASKDIALOG_BUTTON structures in the pButtons array, or one of the IDs corresponding to the buttons specified in the dwCommonButtons member:
IDCANCEL Make the Cancel button the default.
IDNO Make the No button the default.
IDOK Make the OK button the default.
IDRETRY Make the Retry button the default.
IDYES Make the Yes button the default.
IDCLOSE Make the Close button the default."
The above bit shamelessly quoted from MSDN.
So basically, if you're using the standard predefined buttons, set the field to one of the above constants; if you're using a custom button, set it to the ID you use when specifying the button.
In addition to answer given by David, I would add my two cents - If you are using MFC, you may use CTaskDialog class.

Flex 4 DropDownList Selected Item

the standard behaviour of a Flex dropdownlist is to disable the currently selected item from the list. Does anybody know how to override this to allow the user to re-select the selected item (if they so desire)?
NOTE: I don't want there to be a selected item in the list but I still want the selecteditem property to be set in the dropdownlist control, otherwise how will I know what has been selected. This is slighly trickier than it sounds...unless I have missed something...
Thanks
Mark
I'm not sure I understand the question but you can listen to close event of the component :
Dispatched when the drop-down list closes for any reason, such when the user: Selects an item in the drop-down list. Clicks outside of the drop-down list. Clicks the anchor button while the drop-down list is displayed.
So, you can access the component and gather the selectedIndex, selectedItem properties.
I guess what I'd like to know is that why you want to "re-select", possible to trigger something again but I'd try close event...

Basic Cocoa Bindings: Toggle a boolean from menu in IB

I'm just getting started with Cocoa Bindings and while I've read through much of the documentation, I'm still struggling to implement a basic feature, making me question wether I'm doing it wrong or perhaps it's just not possible via IB.
Goal: Have a menu item called "Toggle visibility" toggle the state of a Boolean property in my application controller (AppController) called "visibility." I think this should be possible completely through IB.
(Note: CoreData is not in use here)
What I think needs to happen is I need to have an NSObjectController who's content outlet is set to my AppController class. Then I think I need to use an Action Innvocation binding. But here's where I run into trouble.
Should the Controller Key be selection? Should the Model Key Path be the name of my Boolean Property? What should Selector Name be?
Or do I need to setup a separate action method called "toggleVisibility" that I can bind to? If I did, why wouldn't I just use standard target/action associations, rather than bindings?
Any input / direction appreciated.
Goal: Have a menu item called "Toggle visibility" toggle the state of a Boolean property in my application controller (AppController) called "visibility."
Your goal tells you why you are failing.
In your description of your goal, you say that you want to set this menu item up as a command, a verb, an imperative sentence—“toggle the visibility”. But that's not the right title for the menu item.
Moreover, implementing a verb menu item with Bindings is inherently difficult because Bindings is the wrong tool for the job. Bindings is for exposing properties in your UI. It isn't for performing commands.
The correct title is supported by the correct Bindings-based solution.
The correct title of the menu item is, simply, “Visible”.
This alone should give you a hint as to how to proceed. Here's another: When the selection is visible, the menu item should have a check mark; when it is not visible, the menu item should have no mark.
You want to bind a property of the menu item to, ultimately, a Boolean property of your controller. Normally, this property of the menu item would be state, but for whatever reason, the binding for it is named value.
So, bind the value binding of the menu item to the Boolean property of your controller.

Resources