CFrameWindow Class Reference

Search Toolkit Book for CFrameWindow

#include <frame_window.hpp>

Inheritance diagram for CFrameWindow:

Inheritance graph
[legend]
Collaboration diagram for CFrameWindow:

Collaboration graph
[legend]
List of all members.

Detailed Description

CFrameWindow - top-level frame window providing basic services to its child widgets such as:

Definition at line 77 of file frame_window.hpp.

Public Types

typedef Fl_Double_Window TParent
typedef CFrameWindowEvent TEvent
enum  EEventType { eCloseWindow = CEvent::eEvent_MinClientID }

Public Member Functions

 CFrameWindow (int x, int y, int w, int h, const char *title=NULL)
virtual ~CFrameWindow ()
virtual void ResetMenu (const CMenuItem &item)
 Replace existing menu with one specified by "item", make it a "backbone" (default) menu of the window and then merge Client's menu into it.
virtual void ResetMenu ()
 Resets current menu to "backbone".
virtual void UpdateMenu ()
 Requestincremental update of the existing menu.
virtual void MergeMenu (const CMenuItem &item)
 Merge provided menu into exisitng FrameWindow's menu.
virtual void ResetToolBar (const CMenuItem &item)
virtual void SetClient (IFrameWindowClient *client)
virtual void RemoveClient ()
virtual void Show ()
 NCBI-style callables.
virtual void Show (int argc, char **argv)
virtual bool Shown () const
virtual void Hide ()
Fl_Widget overridables
virtual void show ()
virtual void hide ()
virtual void resize (int x, int y, int w, int h)
virtual int handle (int event)
ITimerListener implementation
virtual void OnTimeout (int timer_id)
IMenuHintListener implementation
virtual void OnHint (const string &hint)

Protected Member Functions

Fl_Widget * x_ClientWidget ()
virtual void x_SetupStatusBar ()
 override this function in derived class to create application-specific status bar
virtual void x_AddClientMenu ()
virtual void x_Layout ()
virtual void x_OnUpdateUI ()
virtual bool x_HandleAccelerator ()
virtual bool x_HandleMenuActivate (int event)
virtual void x_OnCloseWindow ()

Static Protected Member Functions

static void x_OnUpdateUI (void *data)
static void x_WidgetCallback (Fl_Widget *, void *)

Protected Attributes

CMenuItemm_BaseMenu
 static backbone that does not depend on Client
CMenuBarm_MenuBar
int m_MenuBarH
CMenuItemm_BaseToolBar
CMenuBarm_ToolBar
int m_ToolBarH
CStatusBar1m_StatusBar
CStatusBar1::TSlotHandle m_CmdHintSlot
int m_StatusBarH
Fl_Group * m_ClientGroup
IFrameWindowClientm_Client
CCommandTargetm_CmdTarget
CFLTKTimer m_UpdateUITimer
CGUIEvent m_Event
int m_AltPressed

Classes

class  CFrameWindowEvent
 CEvent represents events generated by CFrameWindow. More...


Member Typedef Documentation

typedef CFrameWindowEvent CFrameWindow::TEvent
 

Definition at line 96 of file frame_window.hpp.

typedef Fl_Double_Window CFrameWindow::TParent
 

Definition at line 84 of file frame_window.hpp.


Member Enumeration Documentation

enum CFrameWindow::EEventType
 

Enumerator:
eCloseWindow 

Definition at line 86 of file frame_window.hpp.


Constructor & Destructor Documentation

CFrameWindow::CFrameWindow int  x,
int  y,
int  w,
int  h,
const char *  title = NULL
 

Definition at line 43 of file frame_window.cpp.

References CMenu::GetPreferredSize(), CFLTKTimer::Init(), kUpdateTimerID, kUpdateUIPeriod, m_BaseMenu, m_BaseToolBar, m_ClientGroup, m_Event, m_MenuBar, m_MenuBarH, m_StatusBarH, m_ToolBar, m_ToolBarH, m_UpdateUITimer, CMenu::SetCmdTarget(), CMenu::SetHintListener(), CMenu::SetItems(), CGUIEvent::StandardConfig(), x_SetupStatusBar(), x_WidgetCallback(), and CPoint::Y().

CFrameWindow::~CFrameWindow  )  [virtual]
 

Definition at line 97 of file frame_window.cpp.

References hide(), m_BaseMenu, m_MenuBar, and m_ToolBar.


Member Function Documentation

int CFrameWindow::handle int  event  )  [virtual]
 

this a workaround for FLTK bug(feature?). FL_KEYUP is not forwarded to "grab" widget, we do it here explicitly. This is needed for menu bars.

Definition at line 311 of file frame_window.cpp.

References m_Event, CGUIEvent::OnFLTKEvent(), x_HandleAccelerator(), and x_HandleMenuActivate().

void CFrameWindow::Hide  )  [virtual]
 

Definition at line 278 of file frame_window.cpp.

References hide().

void CFrameWindow::hide  )  [virtual]
 

Definition at line 295 of file frame_window.cpp.

References m_UpdateUITimer, and CFLTKTimer::Stop().

Referenced by Hide(), CWorkspaceApp::OnExit(), CWinManagerApp::OnExit(), CMenuDemoApp::OnExit(), CMenuDemoApp::OnExitEvent(), and ~CFrameWindow().

void CFrameWindow::MergeMenu const CMenuItem item  )  [virtual]
 

Merge provided menu into exisitng FrameWindow's menu.

This does not affect "backbone" menu of the Frame.

Definition at line 182 of file frame_window.cpp.

References CMenuItem::Clone(), CMenu::GetPreferredSize(), CMenu::GetRootItem(), m_MenuBar, m_MenuBarH, CMenuItem::Merge(), CMenu::SetItems(), x_Layout(), and CPoint::Y().

Referenced by x_AddClientMenu().

void CFrameWindow::OnHint const string &  hint  )  [virtual]
 

Implements IMenuHintListener.

Definition at line 446 of file frame_window.cpp.

References m_CmdHintSlot, m_StatusBar, and CStatusBar1::SetSlotText().

void CFrameWindow::OnTimeout int  timer_id  )  [virtual]
 

Implements ITimerListener.

Definition at line 425 of file frame_window.cpp.

References kUpdateTimerID, and x_OnUpdateUI().

void CFrameWindow::RemoveClient  )  [virtual]
 

Definition at line 210 of file frame_window.cpp.

References CMenu::GetPreferredSize(), m_Client, m_ClientGroup, m_CmdTarget, m_MenuBar, m_MenuBarH, CEventHandler::RemoveListener(), IFrameWindowClient::SetFrameWindow(), CMenu::SetItems(), x_Layout(), and CPoint::Y().

Referenced by SetClient().

void CFrameWindow::ResetMenu  )  [virtual]
 

Resets current menu to "backbone".

Definition at line 136 of file frame_window.cpp.

References CMenuItem::Clone(), CMenu::GetPreferredSize(), m_BaseMenu, m_MenuBar, m_MenuBarH, CMenu::SetItems(), x_AddClientMenu(), x_Layout(), and CPoint::Y().

void CFrameWindow::ResetMenu const CMenuItem item  )  [virtual]
 

Replace existing menu with one specified by "item", make it a "backbone" (default) menu of the window and then merge Client's menu into it.

Definition at line 119 of file frame_window.cpp.

References CMenuItem::Clone(), CMenu::GetPreferredSize(), m_BaseMenu, m_MenuBar, m_MenuBarH, CMenuItem::Merge(), CMenu::SetItems(), x_AddClientMenu(), x_Layout(), and CPoint::Y().

Referenced by CMenuDemoApp::x_Create(), and CWindowManager::x_ResetMenu().

void CFrameWindow::ResetToolBar const CMenuItem item  )  [virtual]
 

Definition at line 168 of file frame_window.cpp.

References CMenuItem::Clone(), CMenu::GetPreferredSize(), m_ToolBar, m_ToolBarH, CMenu::SetItems(), x_Layout(), and CPoint::Y().

Referenced by CMenuDemoApp::x_Create().

void CFrameWindow::resize int  x,
int  y,
int  w,
int  h
[virtual]
 

Definition at line 303 of file frame_window.cpp.

References pythonpp::resize(), and x_Layout().

Referenced by CGBenchFrameWindow::LoadSettings().

void CFrameWindow::SetClient IFrameWindowClient client  )  [virtual]
 

Definition at line 232 of file frame_window.cpp.

References CEventHandler::AddListener(), CMenu::GetPreferredSize(), m_Client, m_ClientGroup, m_CmdTarget, m_MenuBar, m_MenuBarH, RemoveClient(), IFrameWindowClient::SetFrameWindow(), x_AddClientMenu(), x_Layout(), and CPoint::Y().

Referenced by CMenuDemoApp::x_Create(), CWorkspaceApp::x_Destroy(), CWinManagerApp::x_Destroy(), and CMenuDemoApp::x_Destroy().

void CFrameWindow::Show int  argc,
char **  argv
[virtual]
 

Definition at line 264 of file frame_window.cpp.

References CFLTKTimer::IsRunning(), m_UpdateUITimer, and CFLTKTimer::Start().

void CFrameWindow::Show  )  [virtual]
 

NCBI-style callables.

Definition at line 258 of file frame_window.cpp.

References show().

Referenced by CGBenchApp::Raise(), and CGBenchApp::Run().

void CFrameWindow::show  )  [virtual]
 

Definition at line 283 of file frame_window.cpp.

References CFLTKTimer::IsRunning(), m_UpdateUITimer, and CFLTKTimer::Start().

Referenced by CWorkspaceApp::Run(), CWinManagerApp::Run(), CMenuDemoApp::Run(), and Show().

bool CFrameWindow::Shown  )  const [virtual]
 

Definition at line 273 of file frame_window.cpp.

void CFrameWindow::UpdateMenu  )  [virtual]
 

Requestincremental update of the existing menu.

Definition at line 150 of file frame_window.cpp.

References _ASSERT, CMenuItem::Clone(), CMenu::GetPreferredSize(), CMenu::GetRootItem(), m_Client, m_MenuBar, m_MenuBarH, CMenu::SetItems(), IFrameWindowClient::UpdateMenu(), x_Layout(), and CPoint::Y().

void CFrameWindow::x_AddClientMenu  )  [protected, virtual]
 

Definition at line 198 of file frame_window.cpp.

References IFrameWindowClient::GetMenu(), m_Client, and MergeMenu().

Referenced by ResetMenu(), and SetClient().

Fl_Widget * CFrameWindow::x_ClientWidget  )  [protected]
 

Definition at line 406 of file frame_window.cpp.

References m_Client.

bool CFrameWindow::x_HandleAccelerator  )  [protected, virtual]
 

Definition at line 337 of file frame_window.cpp.

References eCmdInvalid, CGUIEvent::GetAccelByEvent(), CAccelTable::GetCommandByAccel(), m_Event, and CCommandTarget::OnCommand().

Referenced by handle().

bool CFrameWindow::x_HandleMenuActivate int  event  )  [protected, virtual]
 

Definition at line 350 of file frame_window.cpp.

References CMenuBar::Activate(), CMenu::GetItemByAccessKey(), m_AltPressed, and m_MenuBar.

Referenced by handle().

void CFrameWindow::x_Layout  )  [protected, virtual]
 

Definition at line 413 of file frame_window.cpp.

References m_Client, m_ClientGroup, m_MenuBar, m_MenuBarH, m_StatusBar, m_StatusBarH, m_ToolBar, m_ToolBarH, and CStatusBar1::resize().

Referenced by MergeMenu(), RemoveClient(), ResetMenu(), ResetToolBar(), resize(), SetClient(), and UpdateMenu().

void CFrameWindow::x_OnCloseWindow  )  [protected, virtual]
 

Definition at line 463 of file frame_window.cpp.

References eCloseWindow, and CEventHandler::Send().

Referenced by x_WidgetCallback().

static void CFrameWindow::x_OnUpdateUI void *  data  )  [static, protected]
 

void CFrameWindow::x_OnUpdateUI  )  [protected, virtual]
 

Definition at line 433 of file frame_window.cpp.

References m_MenuBar, m_ToolBar, and CMenuBar::UpdateItems().

Referenced by OnTimeout().

void CFrameWindow::x_SetupStatusBar  )  [protected, virtual]
 

override this function in derived class to create application-specific status bar

Definition at line 107 of file frame_window.cpp.

References CStatusBar1::CreateSlot(), ISBSlot::fResizable, m_CmdHintSlot, m_StatusBar, m_StatusBarH, CStatusBar1::SetSlotStyles(), and CStatusBar1::SetStatusBar().

Referenced by CFrameWindow().

void CFrameWindow::x_WidgetCallback Fl_Widget *  ,
void * 
[static, protected]
 

Definition at line 454 of file frame_window.cpp.

References x_OnCloseWindow().

Referenced by CFrameWindow().


Member Data Documentation

int CFrameWindow::m_AltPressed [protected]
 

Definition at line 180 of file frame_window.hpp.

Referenced by x_HandleMenuActivate().

CMenuItem* CFrameWindow::m_BaseMenu [protected]
 

static backbone that does not depend on Client

Definition at line 163 of file frame_window.hpp.

Referenced by CFrameWindow(), ResetMenu(), and ~CFrameWindow().

CMenuItem* CFrameWindow::m_BaseToolBar [protected]
 

Definition at line 167 of file frame_window.hpp.

Referenced by CFrameWindow().

IFrameWindowClient* CFrameWindow::m_Client [protected]
 

Definition at line 176 of file frame_window.hpp.

Referenced by RemoveClient(), SetClient(), UpdateMenu(), x_AddClientMenu(), x_ClientWidget(), and x_Layout().

Fl_Group* CFrameWindow::m_ClientGroup [protected]
 

Definition at line 175 of file frame_window.hpp.

Referenced by CFrameWindow(), RemoveClient(), SetClient(), and x_Layout().

CStatusBar1::TSlotHandle CFrameWindow::m_CmdHintSlot [protected]
 

Definition at line 172 of file frame_window.hpp.

Referenced by OnHint(), and x_SetupStatusBar().

CCommandTarget* CFrameWindow::m_CmdTarget [protected]
 

Definition at line 177 of file frame_window.hpp.

Referenced by RemoveClient(), and SetClient().

CGUIEvent CFrameWindow::m_Event [protected]
 

Definition at line 179 of file frame_window.hpp.

Referenced by CFrameWindow(), handle(), and x_HandleAccelerator().

CMenuBar* CFrameWindow::m_MenuBar [protected]
 

Definition at line 164 of file frame_window.hpp.

Referenced by CFrameWindow(), MergeMenu(), RemoveClient(), ResetMenu(), SetClient(), UpdateMenu(), x_HandleMenuActivate(), x_Layout(), x_OnUpdateUI(), and ~CFrameWindow().

int CFrameWindow::m_MenuBarH [protected]
 

Definition at line 165 of file frame_window.hpp.

Referenced by CFrameWindow(), MergeMenu(), RemoveClient(), ResetMenu(), SetClient(), UpdateMenu(), and x_Layout().

CStatusBar1* CFrameWindow::m_StatusBar [protected]
 

Definition at line 171 of file frame_window.hpp.

Referenced by OnHint(), x_Layout(), and x_SetupStatusBar().

int CFrameWindow::m_StatusBarH [protected]
 

Definition at line 173 of file frame_window.hpp.

Referenced by CFrameWindow(), x_Layout(), and x_SetupStatusBar().

CMenuBar* CFrameWindow::m_ToolBar [protected]
 

Definition at line 168 of file frame_window.hpp.

Referenced by CFrameWindow(), ResetToolBar(), x_Layout(), x_OnUpdateUI(), and ~CFrameWindow().

int CFrameWindow::m_ToolBarH [protected]
 

Definition at line 169 of file frame_window.hpp.

Referenced by CFrameWindow(), ResetToolBar(), and x_Layout().

CFLTKTimer CFrameWindow::m_UpdateUITimer [protected]
 

Definition at line 178 of file frame_window.hpp.

Referenced by CFrameWindow(), hide(), show(), and Show().


The documentation for this class was generated from the following files:
Generated on Mon Nov 9 11:44:27 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Nov 09 15:47:27 2009 by modify_doxy.py rev. 173732