void wxNonOwnedWindow::HandleResized( double timestampsec )
{
    SendSizeEvent();
    // we have to inform some controls that have to reset things
    // relative to the toplevel window (e.g. OpenGL buffers)
    wxWindowMac::MacSuperChangedPosition() ; // like this only children will be notified
}
Example #2
0
void FindResultsTab::OnSearchStart(wxCommandEvent& e)
{
    m_searchInProgress = true;
    SearchData* data = (SearchData*)e.GetClientData();
    wxString label = data ? data->GetFindString() : wxT("");

    if(e.GetInt() != 0 || m_sci == NULL) {
        if(m_book) {
            clWindowUpdateLocker locker(this);
            MySTC* sci = new MySTC(m_book);
            SetStyles(sci);
            sci->Connect(wxEVT_STC_STYLENEEDED, wxStyledTextEventHandler(FindResultsTab::OnStyleNeeded), NULL, this);
            m_book->AddPage(sci, label, true);
#ifdef __WXMAC__
            m_book->GetSizer()->Layout();
#endif
            size_t where = m_book->GetPageCount() - 1;

            // keep the search data used for this tab
            wxWindow* tab = m_book->GetPage(where);
            if(tab) {
                tab->SetClientData(data);
            }

            m_matchInfo.push_back(MatchInfo());
            m_sci = sci;
        }
    } else if(m_book) {
        // using current tab, update the tab title and the search data
        int where = m_book->GetPageIndex(m_sci);
        if(where != wxNOT_FOUND) {
            m_book->SetPageText(where, label);
            // delete the old search data
            wxWindow* tab = m_book->GetPage(where);
            SearchData* oldData = (SearchData*)tab->GetClientData();
            if(oldData) {
                delete oldData;
            }
            // set the new search data
            tab->SetClientData(data);
        }
    }

    // This is needed in >=wxGTK-2.9, otherwise the 'Search' pane doesn't fully expand
    SendSizeEvent(wxSEND_EVENT_POST);

    m_recv = m_sci;
    Clear();

    if(data) {
        m_searchData = *data;

        wxString message;
        message << _("====== Searching for: '") << data->GetFindString() << _("'; Match case: ")
                << (data->IsMatchCase() ? _("true") : _("false")) << _(" ; Match whole word: ")
                << (data->IsMatchWholeWord() ? _("true") : _("false")) << _(" ; Regular expression: ")
                << (data->IsRegularExpression() ? _("true") : _("false")) << wxT(" ======\n");
        AppendText(message);
    }
}
Example #3
0
FB_Frame::FB_Frame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) :
    wxFrame( parent, id, caption, pos, size, style ) {
    wxSystemOptions::SetOption(wxT("msw.notebook.themed-background"), 0);
    m_Config = new FB_Config(  );
    m_DocList = new FB_DocList;
    m_StatusBar = new FB_StatusBar( this );
    m_ToolBar = new FB_ToolBar( this );
        
    if ( m_Config->winw==-1||m_Config->winh==-1 ) {
        SetSize(300, 200);
        Centre();
        Maximize();
    }
    else {
        Move(m_Config->winx, m_Config->winy);
        SetSize(m_Config->winw, m_Config->winh);
    }
    Show( true );
        
    m_Code_area = NULL;
    m_ActiveTabID = -1;
    
    Freeze();
        CreateMenus();
        CreateToolbar();
        CreatePanels();
        CreateStatusBar();
    Thaw();

    SendSizeEvent();
    SetStatus();
    m_Config->m_FileHistory->AddFilesToMenu();
}
void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged()
{
    PCB_BASE_EDIT_FRAME::CommonSettingsChanged();

    Layout();
    SendSizeEvent();
}
Example #5
0
void my1Form::OnCheckOptions(wxCommandEvent &event)
{
	my1Options currOptions = { 0, mCanvas->mImageWidth, mCanvas->mImageHeight,
	   	mCanvas->mImageGridSize, mCanvas->mImageBankSize };
	my1OptionDialog *prefDialog = new my1OptionDialog(this, wxT("Options"), currOptions);
	prefDialog->ShowModal();
	prefDialog->Destroy(); // double deletion if done here!

	if(currOptions.mChanged)
	{
		mCanvas->mImageWidth = currOptions.mWidth;
		mCanvas->mImageHeight = currOptions.mHeight;
		mCanvas->mImageGridSize = currOptions.mGridSize;
		mCanvas->mImageBankSize = currOptions.mBankSize;
		//wxMessageBox(wxT("Changing Display!"),wxT("Just FYI"),wxOK|wxICON_INFORMATION,this);

		//Freeze();
		SetClientSize(mCanvas->mImageWidth*mCanvas->mImageGridSize,
			mCanvas->mImageHeight*mCanvas->mImageGridSize);
		mCanvas->RedrawGrid();
		// try to rescale instead of clearing!
		mCanvas->RescaleImage();
		//mCanvas->ResetImage();
		SendSizeEvent();
		//Thaw();
		Refresh();
	}
}
Example #6
0
wxStatusBar* wxFrame::CreateStatusBar(int number, long style,
                                      wxWindowID id, const wxString& name)
{
    wxStatusBar *bar = wxFrameBase::CreateStatusBar(number, style, id, name);
    SendSizeEvent();
    return bar;
}
bool wxNonOwnedWindow::OSXShowWithEffect(bool show,
                                         wxShowEffect effect,
                                         unsigned timeout)
{
    // Cocoa code needs to manage window visibility on its own and so calls
    // wxWindow::Show() as needed but if we already changed the internal
    // visibility flag here, Show() would do nothing, so avoid doing it
#if wxOSX_USE_CARBON
    if ( !wxWindow::Show(show) )
        return false;
#endif // Carbon

    if ( effect == wxSHOW_EFFECT_NONE ||
            !m_nowpeer || !m_nowpeer->ShowWithEffect(show, effect, timeout) )
        return Show(show);

    if ( show )
    {
        // as apps expect a size event to occur when the window is shown,
        // generate one when it is shown with effect too
        SendSizeEvent();
    }

    return true;
}
Example #8
0
void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
{
    // wxMSW prior to 2.5.3 created MDI child frames as visible, which resulted
    // in flicker e.g. when the frame contained controls with non-trivial
    // layout. Since 2.5.3, the frame is created hidden as all other top level
    // windows. In order to maintain backward compatibility, the frame is shown
    // in OnIdle, unless Show(false) was called by the programmer before.
    if ( m_needsInitialShow )
    {
        Show(true);
    }

    // MDI child frames get their WM_SIZE when they're constructed but at this
    // moment they don't have any children yet so all child windows will be
    // positioned incorrectly when they are added later - to fix this, we
    // generate an artificial size event here
    if ( m_needsResize )
    {
        m_needsResize = false; // avoid any possibility of recursion

        SendSizeEvent();
    }

    event.Skip();
}
// Enable and disable the status bar
void CFrame::OnToggleStatusbar(wxCommandEvent& event)
{
  SConfig::GetInstance().m_InterfaceStatusbar = event.IsChecked();

  GetStatusBar()->Show(event.IsChecked());

  SendSizeEvent();
}
void LIB_EDIT_FRAME::CommonSettingsChanged()
{
    SCH_BASE_FRAME::CommonSettingsChanged();

    ReCreateHToolbar();
    ReCreateVToolbar();
    ReCreateOptToolbar();
    Layout();
    SendSizeEvent();
}
Example #11
0
void wxTopLevelWindowMac::ShowWithoutActivating()
{
    // wxTopLevelWindowBase is derived from wxNonOwnedWindow, so don't
    // call it here.
    if ( !wxWindow::Show(true) )
        return;

    m_nowpeer->ShowWithoutActivating();

    // because apps expect a size event to occur at this moment
    SendSizeEvent();
}
void TemplateFrame::DisplayStatusBar(bool show)
{
	LOG_MSG("Entering TemplateFrame::DisplayStatusBar");
	wxStatusBar* sb = 0;
	if (!is_status_bar_visible && show) {
		is_status_bar_visible = true;
		if (!GetStatusBar()) {
			sb = new wxStatusBar(this);
			SetStatusBar(sb);
		}
		SendSizeEvent();
	} else if (is_status_bar_visible && !show) {
		is_status_bar_visible = false;
		sb = GetStatusBar();
		if (sb) {
			SetStatusBar(0);
			delete sb;
		}
		SendSizeEvent();
	}
	LOG(is_status_bar_visible);
	LOG_MSG("Exiting TemplateFrame::DisplayStatusBar");
}
void WebFrame::OnFind(wxCommandEvent& WXUNUSED(evt))
{
    wxString value = m_browser->GetSelectedText();
    if(value.Len() > 150)
    {
        value.Truncate(150);
    }
    m_find_ctrl->SetValue(value);
    if(!m_find_toolbar->IsShown()){
        m_find_toolbar->Show(true);
        SendSizeEvent();
    }
    m_find_ctrl->SelectAll();
}
Example #14
0
void wxMDIChildFrame::OnIdle(wxIdleEvent& event)
{
    // MDI child frames get their WM_SIZE when they're constructed but at this
    // moment they don't have any children yet so all child windows will be
    // positioned incorrectly when they are added later - to fix this, we
    // generate an artificial size event here
    if ( m_needsResize )
    {
        m_needsResize = false; // avoid any possibility of recursion

        SendSizeEvent();
    }

    event.Skip();
}
bool wxNonOwnedWindow::Show(bool show)
{
    if ( !wxWindow::Show(show) )
        return false;

    if ( m_nowpeer )
        m_nowpeer->Show(show);

    if ( show )
    {
        // because apps expect a size event to occur at this moment
        SendSizeEvent();
    }

    return true ;
}
EditorFrame::EditorFrame(wxWindow* aParent)
{
    wxXmlResource::Get()->LoadFrame(this, aParent, wxT("editor_frame"));

    SetName("editor");

    SetIcon(wxICON(appicon));

    SetupDefaultGeckoWindow();

    SendSizeEvent(); // 
    
    CreateStatusBar();

    MakeEditable();

    mCommandManager = do_GetInterface(mWebBrowser);

    nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mWebBrowser);
    webNav->LoadURI(NS_ConvertASCIItoUTF16("www.mozilla.org").get(),
        nsIWebNavigation::LOAD_FLAGS_NONE, nsnull, nsnull, nsnull);

}
Example #17
0
// Toggles fullscreen mode
void FB_Frame::OnFullScreen( wxCommandEvent& event ) {
    ShowFullScreen( !IsFullScreen(), wxFULLSCREEN_NOCAPTION | wxFULLSCREEN_NOBORDER );
    SendSizeEvent();
}
Example #18
0
//---------------------------------------------------------
bool CACTIVE::Set_Active(CWKSP_Base_Item *pItem)
{
	if( pItem == m_pItem )
	{
		return( true );
	}

	//-----------------------------------------------------
	m_pItem		= pItem;

	if( m_pParameters )	m_pParameters->Set_Parameters(m_pItem);

	Update_Description();

	STATUSBAR_Set_Text(SG_T(""), STATUSBAR_VIEW_X);
	STATUSBAR_Set_Text(SG_T(""), STATUSBAR_VIEW_Y);
	STATUSBAR_Set_Text(SG_T(""), STATUSBAR_VIEW_Z);

	//-----------------------------------------------------
	if( m_pItem == NULL )
	{
		if( g_pSAGA_Frame   )	g_pSAGA_Frame->Set_Pane_Caption(this, _TL("Properties"));

		if( g_pData_Buttons )	g_pData_Buttons->Refresh();
		if( g_pMap_Buttons  )	g_pMap_Buttons ->Refresh();

		_Hide_Page(m_pHistory);
		_Hide_Page(m_pLegend);
		_Hide_Page(m_pAttributes);

		SendSizeEvent();

		return( true );
	}

	//-----------------------------------------------------
	if( g_pSAGA_Frame )	g_pSAGA_Frame->Set_Pane_Caption(this, wxString(_TL("Properties")) + ": " + m_pItem->Get_Name());

	//-----------------------------------------------------
	if( Get_Active_Data_Item() )
	{	_Show_Page(m_pHistory   );	}	else	{	_Hide_Page(m_pHistory   );	}

	if( Get_Active_Layer() || Get_Active_Map() )
	{	_Show_Page(m_pLegend    );	}	else	{	_Hide_Page(m_pLegend    );	}

	if( Get_Active_Layer() )
	{	_Show_Page(m_pAttributes);	}	else	{	_Hide_Page(m_pAttributes);	}

	//-----------------------------------------------------
	if( g_pData_Buttons )	g_pData_Buttons->Refresh(false);
	if( g_pMap_Buttons  )	g_pMap_Buttons ->Refresh(false);

	if( g_pData_Source  )	g_pData_Source->Set_Data_Source(m_pItem);

	//-----------------------------------------------------
	CSG_Data_Object	*pObject	= Get_Active_Data_Item() ? Get_Active_Data_Item()->Get_Object() : NULL;

	if( SG_Get_Data_Manager().Exists(pObject) &&
	(	(pObject->Get_ObjectType() == DATAOBJECT_TYPE_Table      && ((CSG_Table      *)pObject)->Get_Selection_Count() > 0)
	||	(pObject->Get_ObjectType() == DATAOBJECT_TYPE_TIN        && ((CSG_Shapes     *)pObject)->Get_Selection_Count() > 0)
	||	(pObject->Get_ObjectType() == DATAOBJECT_TYPE_PointCloud && ((CSG_PointCloud *)pObject)->Get_Selection_Count() > 0)
	||	(pObject->Get_ObjectType() == DATAOBJECT_TYPE_Shapes     && ((CSG_Shapes     *)pObject)->Get_Selection_Count() > 0)) )
	{
		g_pData->Update_Views(pObject);
	}

	SendSizeEvent();

	return( true );
}
Example #19
0
void wxFrame::DetachMenuBar()
{
    wxFrameBase::DetachMenuBar();
    SendSizeEvent();
}
Example #20
0
void wxFrame::AttachMenuBar(wxMenuBar *menubar)
{
    wxFrameBase::AttachMenuBar(menubar);
    SendSizeEvent();
}
void WebFrame::OnFindDone(wxCommandEvent& WXUNUSED(evt))
{
    m_browser->Find("");
    m_find_toolbar->Show(false);
    SendSizeEvent();
}
Example #22
0
CSimpleFrame::CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position, wxSize size) : 
    CBOINCBaseFrame((wxFrame *)NULL, ID_SIMPLEFRAME, title, position, size,
                    wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN)
{
    wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame:: - Overloaded Constructor Function Begin"));

    // Initialize Application
    SetIcons(*icons);
    
    CSkinAdvanced*     pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
    wxString           strMenuName;
    wxString           strMenuDescription;

    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));

    // File menu
    wxMenu *menuFile = new wxMenu;

    strMenuDescription.Printf(
        _("Close the %s window"), 
        pSkinAdvanced->GetApplicationName().c_str()
    );
    strMenuName = _("&Close window");
    strMenuName += wxT("\tCtrl+W");
    menuFile->Append(
        ID_CLOSEWINDOW,
        strMenuName,
        strMenuDescription
    );

    strMenuDescription.Printf(
        _("Exit %s"),
        pSkinAdvanced->GetApplicationName().c_str()
    );

    strMenuName.Printf(
        _("Exit %s"),
        pSkinAdvanced->GetApplicationName().c_str()
    );

    menuFile->Append(
        wxID_EXIT,
        strMenuName,
        strMenuDescription
    );

#ifdef __WXMAC__
    // wxWidgets actually puts this in the BOINCManager menu
    menuFile->Append(
        wxID_PREFERENCES,
        _("Preferences...")
    );
#endif

    // Skins submenu
    m_pSubmenuSkins = new wxMenu;
    
    BuildSkinSubmenu(m_pSubmenuSkins);
    
    // All other skin names will be appended as radio 
    // menu items with ID_SGFIRSTSKINSELECTOR + index
    
    // View menu
    wxMenu *menuView = new wxMenu;


    menuView->Append(
        ID_SGSKINSELECTOR,
        _("Skin"),
        m_pSubmenuSkins,
        _("Select the appearance of the user interface.")
    );

    // Skins submenu always contains the Default entry
    if (m_pSubmenuSkins->GetMenuItemCount() <= 1) {
        menuView->Enable(ID_SGSKINSELECTOR, false);
    }
    menuView->AppendSeparator();
    menuView->Append(
        ID_CHANGEGUI,
        _("Advanced View...\tCtrl+Shift+A"),
        _("Display the advanced graphical interface.")
    );


    // Options menu
    wxMenu *menuOptions = new wxMenu;

    menuOptions->Append(
        ID_PREFERENCES,
        _("Computing &preferences..."),
        _("Configure computing preferences")
    );
    
    menuOptions->Append(
        ID_SGOPTIONS, 
        _("&Other options..."),
        _("Configure display options and proxy settings")
    );

    // Tools menu
    wxMenu *menuTools = new wxMenu;
    menuTools->Append(
        ID_WIZARDATTACHPROJECT, 
        _("&Add project..."),
        _("Add a project")
    );
    menuTools->AppendSeparator();
    menuTools->Append(
        ID_EVENTLOG, 
        _("Event Log...\tCtrl+Shift+E"),
        _("Display diagnostic messages.")
    );

    // Help menu
    wxMenu *menuHelp = new wxMenu;

    strMenuName.Printf(
        _("%s &help"), 
        pSkinAdvanced->GetApplicationShortName().c_str()
    );
    strMenuDescription.Printf(
        _("Show information about %s"), 
        pSkinAdvanced->GetApplicationShortName().c_str()
    );
    menuHelp->Append(
        ID_HELPBOINC,
        strMenuName, 
        strMenuDescription
    );

    strMenuName.Printf(
        _("&%s"), 
        pSkinAdvanced->GetApplicationName().c_str()
    );
    strMenuDescription.Printf(
        _("Show information about the %s"), 
        pSkinAdvanced->GetApplicationName().c_str()
    );
    menuHelp->Append(
        ID_HELPBOINCMANAGER,
        strMenuName, 
        strMenuDescription
    );
    menuHelp->AppendSeparator();
    strMenuName.Printf(
        _("%s &web site"), 
        pSkinAdvanced->GetApplicationShortName().c_str()
    );
    strMenuDescription.Printf(
        _("Show information about BOINC and %s"),
        pSkinAdvanced->GetApplicationName().c_str()
    );
    menuHelp->Append(
        ID_HELPBOINCWEBSITE,
        strMenuName, 
        strMenuDescription
    );
    menuHelp->AppendSeparator();

    strMenuName.Printf(
        _("&About %s..."), 
        pSkinAdvanced->GetApplicationName().c_str()
    );
    menuHelp->Append(
        wxID_ABOUT,
        strMenuName, 
        _("Licensing and copyright information.")
    );

    // construct menu
    m_pMenubar = new wxMenuBar;
    m_pMenubar->Append(
        menuFile,
        _("&File")
    );
    m_pMenubar->Append(
        menuView,
        _("&View")
    );
    m_pMenubar->Append(
        menuOptions,
        _("&Options")
    );
    m_pMenubar->Append(
        menuTools,
        _("&Tools")
    );
    m_pMenubar->Append(
        menuHelp,
        _("&Help")
    );
    
    wxMenuBar* m_pOldMenubar = GetMenuBar();
    SetMenuBar(m_pMenubar);
    if (m_pOldMenubar) {
        delete m_pOldMenubar;
    }

#ifdef __WXGTK__
    // Force a redraw of the menu under Ubuntu's new interface
    SendSizeEvent();
#endif
#ifdef __WXMAC__
    // Mac needs a short delay to ensure that controls are
    // created in proper order to allow keyboard navigation
    m_iFrameRefreshRate = 1;    // 1 millisecond
    m_pPeriodicRPCTimer->Start(m_iFrameRefreshRate);
#endif

    m_Shortcuts[0].Set(wxACCEL_NORMAL, WXK_HELP, ID_HELPBOINCMANAGER);
    m_Shortcuts[1].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'E', ID_EVENTLOG);
    m_Shortcuts[2].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'F', ID_SGDIAGNOSTICLOGFLAGS);
    m_pAccelTable = new wxAcceleratorTable(3, m_Shortcuts);

    SetAcceleratorTable(*m_pAccelTable);
    
    dlgMsgsPtr = NULL;

    m_pBackgroundPanel = new CSimpleGUIPanel(this);
    
    RestoreState();
}
Example #23
0
void wxExFrame::OnCommand(wxCommandEvent& command)
{
    m_IsCommand = true;

    switch (command.GetId())
    {
    case wxID_FIND:
    {
        if (m_FindReplaceDialog != NULL)
        {
            m_FindReplaceDialog->Destroy();
        }

        m_FindFocus = wxWindow::FindFocus();

        // If stc text is selected, copy to find replace data.
        wxExSTC* stc = GetSTC();

        if (stc != NULL)
        {
            stc->GetFindString();
        }

        m_FindReplaceDialog = new wxFindReplaceDialog(
            this, wxExFindReplaceData::Get(), _("Find"));
        m_FindReplaceDialog->Show();
    }
    break;

    case wxID_REPLACE:
    {
        if (m_FindReplaceDialog != NULL)
        {
            m_FindReplaceDialog->Destroy();
        }

        m_FindFocus = wxWindow::FindFocus();

        // If stc text is selected, copy to find replace data.
        wxExSTC* stc = GetSTC();

        if (stc != NULL)
        {
            stc->GetFindString();
        }

        m_FindReplaceDialog = new wxFindReplaceDialog(
            this,
            wxExFindReplaceData::Get(),
            _("Replace"),
            wxFR_REPLACEDIALOG);
        m_FindReplaceDialog->Show();
    }
    break;

    case wxID_OPEN:
        if (!command.GetString().empty())
        {
            wxExSTC* stc = GetSTC();

            if (stc != NULL)
            {
                wxSetWorkingDirectory(stc->GetFileName().GetPath());
            }

            wxArrayString files;
            wxStringTokenizer tkz(command.GetString());

            while (tkz.HasMoreTokens())
            {
                files.Add(tkz.GetNextToken());
            }

            wxExOpenFiles(this, files);
        }
        else
        {
            wxExOpenFilesDialog(this);
        }
        break;

    case ID_VIEW_MENUBAR:
        if (GetMenuBar() != NULL)
        {
            SetMenuBar(NULL);
        }
        else
        {
            SetMenuBar(m_MenuBar);
        }
        break;

    case ID_VIEW_STATUSBAR:
#if wxUSE_STATUSBAR
        if (GetStatusBar() != NULL)
        {
            GetStatusBar()->Show(!GetStatusBar()->IsShown());
            SendSizeEvent();
        }
#endif
        break;

    case ID_VIEW_TITLEBAR:
        if (!(GetWindowStyleFlag() & wxCAPTION))
        {
            SetWindowStyleFlag(wxDEFAULT_FRAME_STYLE);
            Refresh();
        }
        else
        {
            SetWindowStyleFlag(GetWindowStyleFlag() & ~wxCAPTION);
            Refresh();
        }
        break;

    default:
        wxFAIL;
        break;
    }
}
Example #24
0
void wxFrame::SetToolBar(wxToolBar *toolbar)
{
    wxFrameBase::SetToolBar(toolbar);
    SendSizeEvent();
}
Example #25
0
bool Frame::Create(wxFrame * parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
	wxFrame::Create(parent, id, caption, pos, size, style);

	// Init the menu bar
	m_menuBar  = new wxMenuBar( wxMB_DOCKABLE );
	m_fileMenu = new wxMenu();
	m_visualMenu = new wxMenu();

	wxMenuItem *item = new wxMenuItem(m_fileMenu, wxID_EXIT, wxT("E&xit"), wxT("Exit demo"), wxITEM_NORMAL);
	m_fileMenu->Append(item);
	
	m_editMenu = new wxMenu();
	item = new wxMenuItem(m_editMenu, MENU_EDIT_ADD_PAGE, wxT("New Page\tCtrl+N"), wxT("Add New Page"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_INSERT_PAGE, wxT("Insert Page\tCtrl+I"), wxT("Insert New Page"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_DELETE_PAGE, wxT("Delete Page\tCtrl+F4"), wxT("Delete Page"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_SELECT_PAGE_TO_DELETE, wxT("Select Page to Delete"), wxT("Delete Given Page"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_DELETE_ALL, wxT("Delete All Pages"), wxT("Delete All Pages"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_SET_SELECTION, wxT("Set Selection"), wxT("Set Selection"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_ADVANCE_SELECTION_FWD, wxT("Advance Selection Forward"), wxT("Advance Selection Forward"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_EDIT_ADVANCE_SELECTION_BACK, wxT("Advance Selection Backward"), wxT("Advance Selection Backward"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_visualMenu, MENU_SET_ALL_TABS_SHAPE_ANGLE, wxT("Set an inclination of tab header borders"), wxT("Set the shape of tab header"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_SET_PAGE_IMAGE_INDEX, wxT("Set image index of selected page"), wxT("Set image index"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_SHOW_IMAGES, wxT("Show Images"), wxT("Show Images"), wxITEM_CHECK);
	m_editMenu->Append(item);

	wxMenu *styleMenu = new wxMenu();
	item = new wxMenuItem(styleMenu, MENU_USE_DEFULT_STYLE, wxT("Use Default Style"), wxT("Use VC71 Style"), wxITEM_RADIO);
	styleMenu->Append(item);

	item = new wxMenuItem(styleMenu, MENU_USE_VC71_STYLE, wxT("Use VC71 Style"), wxT("Use VC71 Style"), wxITEM_RADIO);
	styleMenu->Append(item);

	item = new wxMenuItem(styleMenu, MENU_USE_VC8_STYLE, wxT("Use VC8 Style"), wxT("Use VC8 Style"), wxITEM_RADIO);
	styleMenu->Append(item);

	item = new wxMenuItem(styleMenu, MENU_USE_FANCY_STYLE, wxT("Use Fancy Style"), wxT("Use Fancy Style"), wxITEM_RADIO);
	styleMenu->Append(item);
	
	item = new wxMenuItem(styleMenu, MENU_USE_FF2_STYLE, wxT("Use Firefox 2 Style"), wxT("Use Firefox 2 Style"), wxITEM_RADIO);
	styleMenu->Append(item);

	m_visualMenu->Append(-1, wxT("Tabs Style"), styleMenu);
	
	item = new wxMenuItem(m_visualMenu, MENU_SELECT_GRADIENT_COLOR_FROM, wxT("Select fancy tab style 'from' color"), wxT("Select fancy tab style 'from' color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	item = new wxMenuItem(m_visualMenu, MENU_SELECT_GRADIENT_COLOR_TO, wxT("Select fancy tab style 'to' color"), wxT("Select fancy tab style 'to' color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	item = new wxMenuItem(m_visualMenu, MENU_SELECT_GRADIENT_COLOR_BORDER, wxT("Select fancy tab style 'border' color"), wxT("Select fancy tab style 'border' color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	m_editMenu->AppendSeparator();
	item = new wxMenuItem(m_editMenu, MENU_HIDE_NAV_BUTTONS, wxT("Hide Navigation Buttons"), wxT("Hide Navigation Buttons"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check(true);

	item = new wxMenuItem(m_editMenu, MENU_HIDE_X, wxT("Hide X Button"), wxT("Hide X Button"), wxITEM_CHECK);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_SMART_TABS, wxT("Smart tabbing"), wxT("Smart tabbing"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check( false );

	item = new wxMenuItem(m_editMenu, MENU_USE_DROP_ARROW_BUTTON, wxT("Use drop down button for tab navigation"), wxT("Use drop down arrow for quick tab navigation"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check( true );
	m_editMenu->AppendSeparator();

	item = new wxMenuItem(m_editMenu, MENU_USE_MOUSE_MIDDLE_BTN, wxT("Use Mouse Middle Button as 'X' button"), wxT("Use Mouse Middle Button as 'X' button"), wxITEM_CHECK);
	m_editMenu->Append(item);
	
	item = new wxMenuItem(m_editMenu, MENU_DCLICK_CLOSES_TAB, wxT("Mouse double click closes tab"), wxT("Mouse double click closes tab"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check(false);

	m_editMenu->AppendSeparator();

	item = new wxMenuItem(m_editMenu, MENU_USE_BOTTOM_TABS, wxT("Use Bottoms Tabs"), wxT("Use Bottoms Tabs"), wxITEM_CHECK);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_ENABLE_TAB, wxT("Enable Tab"), wxT("Enable Tab"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_DISABLE_TAB, wxT("Disable Tab"), wxT("Disable Tab"), wxITEM_NORMAL);
	m_editMenu->Append(item);

	item = new wxMenuItem(m_editMenu, MENU_ENABLE_DRAG_N_DROP, wxT("Enable Drag And Drop of Tabs"), wxT("Enable Drag And Drop of Tabs"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check(false);

	item = new wxMenuItem(m_editMenu, MENU_ALLOW_FOREIGN_DND, wxT("Enable Drag And Drop of Tabs to foreign notebooks"), wxT("Enable Drag And Drop of Tabs to foreign notebooks"), wxITEM_CHECK);
	m_editMenu->Append(item);
	item->Check(false);

	item = new wxMenuItem(m_visualMenu, MENU_DRAW_BORDER, wxT("Draw Border around tab area"), wxT("Draw Border around tab area"), wxITEM_CHECK);
	m_visualMenu->Append(item);
	item->Check(true);

	item = new wxMenuItem(m_visualMenu, MENU_DRAW_TAB_X, wxT("Draw X button On Active Tab"), wxT("Draw X button On Active Tab"), wxITEM_CHECK);
	m_visualMenu->Append(item);
	
	item = new wxMenuItem(m_visualMenu, MENU_SET_ACTIVE_TAB_COLOR, wxT("Select Active Tab Color"), wxT("Select Active Tab Color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	item = new wxMenuItem(m_visualMenu, MENU_SET_TAB_AREA_COLOR, wxT("Select Tab Area Color"), wxT("Select Tab Area Color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);


	item = new wxMenuItem(m_visualMenu, MENU_SET_ACTIVE_TEXT_COLOR, wxT("Select active tab text color"), wxT("Select active tab text color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);

	item = new wxMenuItem(m_visualMenu, MENU_SELECT_NONACTIVE_TEXT_COLOR, wxT("Select NON-active tab text color"), wxT("Select NON-active tab text color"), wxITEM_NORMAL);
	m_visualMenu->Append(item);
	
	item = new wxMenuItem(m_visualMenu, MENU_GRADIENT_BACKGROUND, wxT("Use Gradient Coloring for tab area"), wxT("Use Gradient Coloring for tab area"), wxITEM_CHECK);
	m_visualMenu->Append(item);
	item->Check( false );

	item = new wxMenuItem(m_visualMenu, MENU_COLORFULL_TABS, wxT("Colorful tabs"), wxT("Colorful tabs"), wxITEM_CHECK);
	m_visualMenu->Append(item);
	item->Check( false );

	m_menuBar->Append(m_fileMenu, wxT("&File"));
	m_menuBar->Append(m_editMenu, wxT("&Edit"));
	m_menuBar->Append(m_visualMenu, wxT("&Tab Appearance"));

	SetMenuBar(m_menuBar);

	// Create a right click menu
	wxMenu *rmenu = new wxMenu();
	item = new wxMenuItem(rmenu, MENU_EDIT_DELETE_PAGE, wxT("Close Tab\tCtrl+F4"), wxT("Close Tab"), wxITEM_NORMAL);
	rmenu->Append(item);

	wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(mainSizer);

	long bookStyle = 0; 
	m_bVCStyle ? bookStyle |= wxFNB_VC71 : bookStyle |= 0;
	bookStyle |= wxFNB_TABS_BORDER_SIMPLE;
	bookStyle |= wxFNB_NODRAG;
	bookStyle |= wxFNB_CUSTOM_DLG;

	book = new wxFlatNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(300, 400), bookStyle);
	book->SetCustomizeOptions(wxFNB_CUSTOM_TAB_LOOK | wxFNB_CUSTOM_LOCAL_DRAG | wxFNB_CUSTOM_FOREIGN_DRAG );

	// Allow the second notebook to accept foreign pages
	// from other notebooks around
	bookStyle &= ~(wxFNB_NODRAG);
	bookStyle |= wxFNB_ALLOW_FOREIGN_DND;
	secondBook = new wxFlatNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(300, 400), bookStyle);

	// Set right click menu to the notebook
	book->SetRightClickMenu(rmenu);

	// Set the image list 
	book->SetImageList(&m_ImageList);

	// Add spacer between the books
	wxPanel *spacer = new wxPanel(this, wxID_ANY);
	spacer->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
	mainSizer->Add(book, 6, wxEXPAND);
	mainSizer->Add(spacer, 0, wxALL | wxEXPAND);
	mainSizer->Add(secondBook, 2, wxEXPAND);

	// Add some pages to the second notebook
	Freeze();
	wxTextCtrl *text = new wxTextCtrl(secondBook, wxID_ANY, wxT("Second Book Page 1"), wxDefaultPosition, wxDefaultSize, 
		wxTE_MULTILINE);
	bool ret = secondBook->AddPage(text,  wxT("Second Book Page 1"));

	text = new wxTextCtrl(secondBook, wxID_ANY, wxT("Second Book Page 2"), wxDefaultPosition, wxDefaultSize, 
		wxTE_MULTILINE);
	ret = secondBook->AddPage(text,  wxT("Second Book Page 2"));

	Thaw();	

#ifdef DEVELOPMENT
	text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
                            wxDefaultPosition, wxSize(250, 250),
                            wxTE_MULTILINE | wxTE_READONLY);

    m_logTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(text) );
	mainSizer->Add(text, 1, wxEXPAND);
#endif

	Centre(); 
	mainSizer->Layout();
	SendSizeEvent();
	return true;
}