NCBI C++ ToolKit
|
Search Toolkit Book for CMainFrame
CMainFrame Base class for Application Main Frame, derive your frames from this one. More...
#include <gui/widgets/wx/main_frame.hpp>
Classes | |
class | IHintListener |
IHintListener - an interface for a component that shows command help hints. More... | |
Public Types | |
typedef wxFrame | TParent |
Public Member Functions | |
CMainFrame () | |
Constructors. More... | |
CMainFrame (wxWindow *parent, wxWindowID id, const wxString &caption, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE) | |
~CMainFrame () | |
virtual void | SetHintListener (IHintListener *listener) |
void | OnExitClick (wxCommandEvent &event) |
virtual void | DoGiveHelp (const wxString &text, bool show) |
overriding these function to make it less intrusive More... | |
IRegSettings interface implementation | |
virtual void | SetRegistryPath (const string &path) |
virtual void | LoadSettings () |
virtual void | SaveSettings () const |
Public Member Functions inherited from IRegSettings | |
virtual | ~IRegSettings () |
Protected Member Functions | |
virtual WXLRESULT | MSWWindowProc (WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) |
Override wxFrame::MSWWindowProc() in order to handle WM_ENABLE event. More... | |
void | OnActivate (wxActivateEvent &event) |
void | x_SaveMenuFocus () |
void | x_RestoreMenuFocus () |
Protected Attributes | |
string | m_RegPath |
IHintListener * | m_HintListener |
path in registry More... | |
int | m_ModalCounter |
wxWindow * | m_MenuFocusWnd |
CMainFrame Base class for Application Main Frame, derive your frames from this one.
Definition at line 49 of file main_frame.hpp.
typedef wxFrame CMainFrame::TParent |
Definition at line 65 of file main_frame.hpp.
CMainFrame::CMainFrame | ( | ) |
Constructors.
Definition at line 53 of file main_frame.cpp.
CMainFrame::CMainFrame | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxString & | caption, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxDEFAULT_FRAME_STYLE |
||
) |
Definition at line 58 of file main_frame.cpp.
CMainFrame::~CMainFrame | ( | ) |
Definition at line 70 of file main_frame.cpp.
overriding these function to make it less intrusive
Definition at line 123 of file main_frame.cpp.
References CMainFrame::IHintListener::HideCommandHint(), m_HintListener, CMainFrame::IHintListener::ShowCommandHint(), text(), and ToStdString().
|
virtual |
Implements IRegSettings.
Definition at line 90 of file main_frame.cpp.
References CorrectWindowRect(), CRegistryReadView::GetBool(), CWndLayoutReg::GetInstance(), CWndLayoutReg::GetReadView(), kMaxTag, kWinRectTag, LoadWindowRectFromRegistry(), m_RegPath, and max().
Referenced by CWorkbench::x_InitMainFrame().
|
protectedvirtual |
Override wxFrame::MSWWindowProc() in order to handle WM_ENABLE event.
To make modal dialogs truly modal we need to disable all top-level windows in the application when a modal dialog box is shown.
Enabling all windows will guarantee that they do not get user input. When the system show a modal dialog it send WM_ENABLE (false) event to the main application window, when the dialog is closed WM_ENABLE (true) is sent. We handle these events and enabled / disbale child frames.
Definition at line 158 of file main_frame.cpp.
References _ASSERT, m_ModalCounter, TRUE, x_RestoreMenuFocus(), and x_SaveMenuFocus().
|
protected |
Definition at line 145 of file main_frame.cpp.
References m_MenuFocusWnd.
void CMainFrame::OnExitClick | ( | wxCommandEvent & | event | ) |
Definition at line 138 of file main_frame.cpp.
|
virtual |
Implements IRegSettings.
Definition at line 110 of file main_frame.cpp.
References CWndLayoutReg::GetInstance(), CWndLayoutReg::GetWriteView(), kMaxTag, kWinRectTag, m_RegPath, max(), SaveWindowRectToRegistry(), and CRegistryWriteView::Set().
Referenced by CWorkbench::x_DestroyMainFrame().
|
virtual |
Definition at line 75 of file main_frame.cpp.
References m_HintListener.
Referenced by CWorkbench::x_CreateMainFrame().
Implements IRegSettings.
Definition at line 81 of file main_frame.cpp.
References m_RegPath.
Referenced by CWorkbench::x_InitMainFrame().
|
protected |
Definition at line 209 of file main_frame.cpp.
References m_MenuFocusWnd.
Referenced by MSWWindowProc().
|
protected |
Definition at line 199 of file main_frame.cpp.
References m_MenuFocusWnd.
Referenced by MSWWindowProc().
|
protected |
path in registry
Definition at line 101 of file main_frame.hpp.
Referenced by DoGiveHelp(), and SetHintListener().
|
protected |
Definition at line 105 of file main_frame.hpp.
Referenced by OnActivate(), x_RestoreMenuFocus(), and x_SaveMenuFocus().
|
protected |
Definition at line 104 of file main_frame.hpp.
Referenced by MSWWindowProc().
|
protected |
Definition at line 99 of file main_frame.hpp.
Referenced by LoadSettings(), SaveSettings(), and SetRegistryPath().