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 » Community » Newbie corner » Implementation of ColorPopUp ctrl
Implementation of ColorPopUp ctrl [message #27472] Mon, 19 July 2010 18:48 Go to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

I would like to know how this ctrl is implemented. For instance, shall we say the typical pop up menu, in which the user selects a colour, then press ok or cancel. Is it necessary to set up this control within an ok-cancel prompt menu? Is it operative in its own?.

An additional question, how to close a modal pop up menu when “Escape” is pressed in the keyboard?

Thanks,

Javier
Re: Implementation of ColorPopUp ctrl [message #27473 is a reply to message #27472] Mon, 19 July 2010 20:06 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The easiest way is to have buttons on the dialog with specific names and use the correct version of CtrlLayout. For instance
Buttons 'ok' and 'cancel', call CtrlLayoutOKCancel
Just 'cancel' and CtrlLayoutCancel
Just 'exit' and CtrlLayoutExit

Or you can override TopWindow::Key and catch K_ESCAPE.
Re: Implementation of ColorPopUp ctrl [message #27494 is a reply to message #27472] Wed, 21 July 2010 10:38 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
ColorPupUpCtrl is a ctrl used for a pop-up selection, like the list on a droplist. It is not a dialog.

For a default color selection dialog try 'RunDlgSelectColor'.
Re: Implementation of ColorPopUp ctrl [message #27504 is a reply to message #27494] Wed, 21 July 2010 13:56 Go to previous messageGo to next message
281264 is currently offline  281264
Messages: 270
Registered: June 2010
Location: Spain
Experienced Member
Hi,

Yes, eventually a managed to implement ColorPopup via ColorPusher.

The option you mention, would you mind showing a simple example?

Many thanks. Cheers,

Javier
Re: Implementation of ColorPopUp ctrl [message #27507 is a reply to message #27504] Wed, 21 July 2010 14:28 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
color = RunDlgSelectColor(color);

[Updated on: Wed, 21 July 2010 14:29]

Report message to a moderator

Previous Topic: OpenGL example
Next Topic: Problem with OpenGL functionality: glPrimitiveRestartIndex
Goto Forum:
  


Current Time: Sat Apr 20 03:16:25 CEST 2024

Total time taken to generate the page: 0.02533 seconds