How can I overwrite the OK-Cancel dialog box to keep all my dialog boxes look uniformly?
Or how do I give one of the buttons in my dialog box the "Default" look of the OK button such as in the OK-Cancel dialog box? BTW, what is the size of those buttons? Thanks
victorb Messages: 78 Registered: December 2005 Location: Nice, France
Member
Use the Button::Ok() to give a button a Ok button look (Cancel(), Exit(), Normal() are other method of Button you can use for giving your button different looks).
One solution to have all your OK-Cancel look the same is to design your own OK-Cancel dialog with the layout editor and use it across your code.
If you name your buttons "ok" and "cancel" (lower case) you can invoke CtrlLayoutOKCancel() to set the button look and ID.
You should take a look at the Layout example in the reference code.
Thanks for replying. Using Button:Ok() works for me.
On the second issue, the solution you proposed to come up with a custome OK-Cancel dlg and use across my app is also what I had in mind in the beginning. The problem is in place, we don't have a flexibity to change which OK-Cancel dialog to call. For example, delete a row in an ArrayCtrl which we get the confirmation for free. That's the reason why I asked for a way to overwrite those PromptOK() methods. The look like global function to me, but I have not traced the source code that deeply yet.
kevinle10@gmail.com wrote on Thu, 13 April 2006 11:07
Victorb,
Thanks for replying. Using Button:Ok() works for me.
On the second issue, the solution you proposed to come up with a custome OK-Cancel dlg and use across my app is also what I had in mind in the beginning. The problem is in place, we don't have a flexibity to change which OK-Cancel dialog to call. For example, delete a row in an ArrayCtrl which we get the confirmation for free. That's the reason why I asked for a way to overwrite those PromptOK() methods. The look like global function to me, but I have not traced the source code that deeply yet.
Any other idea? Thanks
Well, they are global functions. The only way that comes to mind is to do ArrayCtrl confirmations yourself - it is not that hard in fact (create your own menu for ArrayCtrl and call its appropriate methods).
Good that you remind that Prompts should be Chameleonized too...
OK, Mirek, are you refering to create context menu (pops up in response to a right click) for the ArrayCtrl? If so, I do not see any right click event.
Could you please point out an example? If not, could you please prepare one? Thanks
ANother issue I'm hitting a road block with ArrayCtrl right now is how can I capture the delete row event. WHat I'm really after is as follow. I'd like to keep my OK button disabled until the state of the ArrayCtrl changes.
So this is what I have so far:
valuesCtrl.WhenStartEdit = THISBACK(OnModified);
void Dlg::OnModified() { ok.Enable(true); }
This works for insert, append and edit but not for delete. Any idea please? I'm almost done. Can't wait to post in the "App created with U++" section.
Neither can I. OK, my mistake. I was searching for something, then I landed in some posting in this category. Without knowing better, I clicked on the "New topic" without realizing I'm already in this category.
kevinle10@gmail.com wrote on Thu, 13 April 2006 12:53
OK, Mirek, are you refering to create context menu (pops up in response to a right click) for the ArrayCtrl? If so, I do not see any right click event.
Could you please point out an example? If not, could you please prepare one? Thanks
ANother issue I'm hitting a road block with ArrayCtrl right now is how can I capture the delete row event. WHat I'm really after is as follow. I'd like to keep my OK button disabled until the state of the ArrayCtrl changes.
So this is what I have so far:
valuesCtrl.WhenStartEdit = THISBACK(OnModified);
void Dlg::OnModified() { ok.Enable(true); }
This works for insert, append and edit but not for delete. Any idea please? I'm almost done. Can't wait to post in the "App created with U++" section.
fudadmin Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
Ultimate Contributor Administrator
kevinle10@gmail.com wrote on Thu, 13 April 2006 20:19
Neither can I. OK, my mistake. I was searching for something, then I landed in some posting in this category. Without knowing better, I clicked on the "New topic" without realizing I'm already in this category.
My question remains ....
No problem. Then we can move it.
P.S. Mirek, try to move items at night and run "forum consistency" etc. (which makes forums offline) or better report them to me (otherwise searching is not working properly).