sjgui::CDlgCtrlTmpl< Tbutton, Tcaption, TclientPanel, TbuttonPanel, Tbase > Class Template ReferenceDialog window with Caption label,Ok and Cancel buttons. More...
Inheritance diagram for sjgui::CDlgCtrlTmpl< Tbutton, Tcaption, TclientPanel, TbuttonPanel, Tbase >:
Detailed Descriptiontemplate<class Tbutton, class Tcaption, class TclientPanel, class TbuttonPanel, class Tbase>
Dialog window with Caption label,Ok and Cancel buttons.
|
Tbutton | - button class |
Tcaption | - label for caption |
TclientPanel | - panel for client area (use CPanelTmpl<>) |
TbuttonPanel | - panel for button area (use CStackPanelTmpl<>) |
Tbase | - base class (use CDlgWndTmpl<>) |
class CCustomTextDlg: public sjgui::CDlg { sjgui::CEdit m_edt; // edit field sjgui::CLabel m_lbl; // label with the hint public: // This string will have the result of user interaction // and it could be accessed by calling class std::string m_str; CCustomTextDlg() { sjgui::CDlg(); SetAutoHide(); // Set autohide option SetCaption("Text Dialog!"); // Change caption SetMinSize(200,100); // Minimum size of the dialog SetSize(250,80); // Default size RegisterChild(&m_lbl); // Register label RegisterChild(&m_edt); // Register edit field m_edt.SetText("sjgui"); // New text for edit field m_lbl.SetText("New Text:"); // Text for hint } // Place edit field in a proper position virtual void OnReshape() { // it should be under the caption m_lbl.PosWnd(5,m_Caption.GetBottom()+1,GetWidth()-10,m_edt.GetHeight()); // it should be under the label m_edt.PosWnd(5,m_lbl.GetBottom()+1,GetWidth()-10,m_edt.GetHeight()); } // React on closing the window, if it was Ok pressed then change the text virtual void OnComplete(){if(m_btnOk.IsPushed())m_str=m_edt.GetText();} }; // end of CCustomTextDlgManual
|
Calls OnComplete if Ok or Cancel buttons were pressed. One should override this function to put their actions inside, if they want some fancy behavior.
|
|
Calls Complete() if Ok or Cancel were pressed. ESC button is a shortcut for Cancel button. |
|
Places controls. One should override this function to do anything if Ok or Cancel button were pressed. |
News Documentation:
Documentation Useful links:
|
Last modified: