Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Overwrite PromptOKCancel
Overwrite PromptOKCancel [message #2450] Thu, 13 April 2006 07:20 Go to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
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
Re: Overwrite PromptOKCancel [message #2456 is a reply to message #2450] Thu, 13 April 2006 13:45 Go to previous messageGo to next message
victorb is currently offline  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.

Re: Overwrite PromptOKCancel [message #2463 is a reply to message #2450] Thu, 13 April 2006 17:07 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
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
Re: Overwrite PromptOKCancel [message #2467 is a reply to message #2463] Thu, 13 April 2006 18:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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... Smile

Mirek
Re: Overwrite PromptOKCancel [message #2472 is a reply to message #2450] Thu, 13 April 2006 18:53 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
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.
Re: Overwrite PromptOKCancel [message #2474 is a reply to message #2472] Thu, 13 April 2006 19:35 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I just can't understand how this topic is related with theIDE compiling? Smile
Re: Overwrite PromptOKCancel [message #2475 is a reply to message #2450] Thu, 13 April 2006 21:19 Go to previous messageGo to next message
kevinle10@gmail.com is currently offline  kevinle10@gmail.com
Messages: 25
Registered: April 2006
Promising Member
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 ....
Re: Overwrite PromptOKCancel [message #2476 is a reply to message #2472] Thu, 13 April 2006 21:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
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.


See ArrayCtrl::WhenBar<Bar&>.

Mirek
Re: Overwrite PromptOKCancel [message #2477 is a reply to message #2475] Thu, 13 April 2006 21:57 Go to previous message
fudadmin is currently offline  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).
Previous Topic: Dialog returned values
Next Topic: Events outside TopWindow
Goto Forum:
  


Current Time: Fri Mar 29 12:02:26 CET 2024

Total time taken to generate the page: 0.01239 seconds