NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CMainFrame Class Reference

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>

+ Inheritance diagram for CMainFrame:
+ Collaboration diagram for CMainFrame:

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
 
IHintListenerm_HintListener
 path in registry More...
 
int m_ModalCounter
 
wxWindow * m_MenuFocusWnd
 

Detailed Description

CMainFrame Base class for Application Main Frame, derive your frames from this one.

Definition at line 49 of file main_frame.hpp.

Member Typedef Documentation

◆ TParent

typedef wxFrame CMainFrame::TParent

Definition at line 65 of file main_frame.hpp.

Constructor & Destructor Documentation

◆ CMainFrame() [1/2]

CMainFrame::CMainFrame ( )

Constructors.

Definition at line 53 of file main_frame.cpp.

◆ CMainFrame() [2/2]

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::~CMainFrame ( )

Definition at line 70 of file main_frame.cpp.

Member Function Documentation

◆ DoGiveHelp()

void CMainFrame::DoGiveHelp ( const wxString &  text,
bool  show 
)
virtual

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().

◆ LoadSettings()

void CMainFrame::LoadSettings ( )
virtual

◆ MSWWindowProc()

WXLRESULT CMainFrame::MSWWindowProc ( WXUINT  message,
WXWPARAM  wParam,
WXLPARAM  lParam 
)
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().

◆ OnActivate()

void CMainFrame::OnActivate ( wxActivateEvent &  event)
protected

Definition at line 145 of file main_frame.cpp.

References m_MenuFocusWnd.

◆ OnExitClick()

void CMainFrame::OnExitClick ( wxCommandEvent &  event)

Definition at line 138 of file main_frame.cpp.

◆ SaveSettings()

void CMainFrame::SaveSettings ( ) const
virtual

◆ SetHintListener()

void CMainFrame::SetHintListener ( IHintListener listener)
virtual

Definition at line 75 of file main_frame.cpp.

References m_HintListener.

Referenced by CWorkbench::x_CreateMainFrame().

◆ SetRegistryPath()

void CMainFrame::SetRegistryPath ( const string path)
virtual

Implements IRegSettings.

Definition at line 81 of file main_frame.cpp.

References m_RegPath.

Referenced by CWorkbench::x_InitMainFrame().

◆ x_RestoreMenuFocus()

void CMainFrame::x_RestoreMenuFocus ( )
protected

Definition at line 209 of file main_frame.cpp.

References m_MenuFocusWnd.

Referenced by MSWWindowProc().

◆ x_SaveMenuFocus()

void CMainFrame::x_SaveMenuFocus ( )
protected

Definition at line 199 of file main_frame.cpp.

References m_MenuFocusWnd.

Referenced by MSWWindowProc().

Member Data Documentation

◆ m_HintListener

IHintListener* CMainFrame::m_HintListener
protected

path in registry

Definition at line 101 of file main_frame.hpp.

Referenced by DoGiveHelp(), and SetHintListener().

◆ m_MenuFocusWnd

wxWindow* CMainFrame::m_MenuFocusWnd
protected

Definition at line 105 of file main_frame.hpp.

Referenced by OnActivate(), x_RestoreMenuFocus(), and x_SaveMenuFocus().

◆ m_ModalCounter

int CMainFrame::m_ModalCounter
protected

Definition at line 104 of file main_frame.hpp.

Referenced by MSWWindowProc().

◆ m_RegPath

string CMainFrame::m_RegPath
protected

Definition at line 99 of file main_frame.hpp.

Referenced by LoadSettings(), SaveSettings(), and SetRegistryPath().


The documentation for this class was generated from the following files:
Modified on Mon May 27 04:40:15 2024 by modify_doxy.py rev. 669887