Inheritance diagram for os::ColorRequester:
Public Member Functions | |
ColorRequester (os::Messenger *pcTarget=NULL) | |
~ColorRequester () | |
Protected Member Functions | |
virtual void | HandleMessage (os::Message *) |
Handle a message targeted at this handler. | |
bool | OkToQuit () |
Check if it is ok to break the loop. | |
Classes | |
class | Private |
ColorRequester* pcColorRequester = new ColorRequester(NULL); pcColorRequester->Show(); ... MyApplication::HandleMessage(Message* pcMessage) { switch (pcMessage->GetCode()) { case M_COLOR_REQUESTED: { os::Color32_s sColor pcMessage->FindColor("color",&sColor); //get the color from the requester and then do anything you want with it pcMyView->SetBgColor(sColor); break; } //this message is useful if you want to update a gui without hitting the okay button case M_COLOR_REQUESTER_CHANGED: { os::Color32_s sColor pcMessage->FindColor("color",&sColor); //get the color from the requester and then do anything you want with it pcMyView->SetBgColor(sColor); break; } case M_COLOR_REQUESTER_CANCELED: { break; //do whatever you need to do when cancelled is called. } } }
ColorRequester::ColorRequester | ( | os::Messenger * | pcTarget = NULL |
) |
ColorRequester::~ColorRequester | ( | ) |
void ColorRequester::HandleMessage | ( | os::Message * | pcMessage | ) | [protected, virtual] |
pcMessage
is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage(). pcMessage | The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(), |
Reimplemented from os::Handler.
bool ColorRequester::OkToQuit | ( | void | ) | [protected, virtual] |
Reimplemented from os::Looper.