Example #1
0
wxGISCoordinatesFormatMenu::wxGISCoordinatesFormatMenu(const wxString& title, long style) : wxMenu(title, style), wxGISCoordinatesFormat()
{
	//preparations
	Serialize(false);
	//TODO:
	/*
	//add selectors m -> cm etc.
	Append(wxID_ANY, _("Kilometers"));
	Append(wxID_ANY, _("Meters"));
	Append(wxID_ANY, _("Decimeters"));
	Append(wxID_ANY, _("Centimeters"));
	Append(wxID_ANY, _("Millimeters"));
	AppendSeparator();
	Append(wxID_ANY, _("Nautical miles"));
	Append(wxID_ANY, _("Miles"));
	Append(wxID_ANY, _("Yards"));
	Append(wxID_ANY, _("Feet"));
	Append(wxID_ANY, _("Inches"));
	AppendSeparator();
	Append(wxID_ANY, _("Degrees"));
	*/
	//add swp coords check mark
	//TODO: AppendSeparator();
	AppendCheckItem(ID_SWAPCOORS, _("Swap coordinates"));
	//TODO: AppendCheckItem(wxID_ANY, _("Add decimal separator"));

	//add formats
	AppendSeparator();
    for(size_t i = 0; i < m_asCoordsMask.GetCount(); ++i)
		Append(ID_MASKBEG + i, m_asCoordsMask[i]);
	//add change format list dialog
	AppendSeparator();
	Append(ID_CHANGEMASKS, _("Change masks"));
}
Example #2
0
void CMenuView::init(void)
{
    setTitle(wxT("表示(&V)"));
    Append(MENU_UPDATE, wxT("更新\tF5"));

    AppendSeparator();
    Append(MENU_VIEW_ZOOM, wxT("拡大\tCtrl++"));
    Append(MENU_VIEW_SHRINK, wxT("縮小\tCtrl+-"));
    AppendSeparator();
    Append(MENU_VIEW_SELECT_NEXT_TAB, wxT("次のタブを選択\tCTRL+Tab"));
    Append(MENU_VIEW_SELECT_PREVOUS_TAB, wxT("前のタブを選択\tCTRL+Shift+Tab"));
}
Example #3
0
wxMenu *TaskBarIcon::CreatePopupMenu()
{
	auto menu = new wxMenu;

	menu->Append(ID_About, _("&About..."));
	menu->Append(ID_UploadKey, _("Upload &Key..."));
	menu->AppendSeparator();
	menu->Append(ID_Log, _("Show &Log..."));
	menu->AppendSeparator();
	menu->Append(ID_Quit, _("E&xit"));

	return menu;
}
Example #4
0
void wxMenu::Init()
{
    m_popupShown = false;

    m_accel = gtk_accel_group_new();
    m_menu = gtk_menu_new();
    // NB: keep reference to the menu so that it is not destroyed behind
    //     our back by GTK+ e.g. when it is removed from menubar:
    g_object_ref_sink(m_menu);

    m_owner = NULL;

    // Tearoffs are entries, just like separators. So if we want this
    // menu to be a tear-off one, we just append a tearoff entry
    // immediately.
    if ( m_style & wxMENU_TEAROFF )
    {
        GtkWidget *tearoff = gtk_tearoff_menu_item_new();

        gtk_menu_shell_append(GTK_MENU_SHELL(m_menu), tearoff);
    }

    // append the title as the very first entry if we have it
    if ( !m_title.empty() )
    {
        Append(wxGTK_TITLE_ID, m_title);
        AppendSeparator();
    }

    // "show" occurs for sub-menus which are not showing, so use "map" instead
    g_signal_connect(m_menu, "map", G_CALLBACK(menu_map), this);
    g_signal_connect(m_menu, "hide", G_CALLBACK(menu_hide), this);
}
Example #5
0
void wxMenu::Init()
{
    m_accel = gtk_accel_group_new();
    m_menu = gtk_menu_new();
    // NB: keep reference to the menu so that it is not destroyed behind
    //     our back by GTK+ e.g. when it is removed from menubar:
    gtk_widget_ref(m_menu);

    m_owner = NULL;

    // Tearoffs are entries, just like separators. So if we want this
    // menu to be a tear-off one, we just append a tearoff entry
    // immediately.
    if ( m_style & wxMENU_TEAROFF )
    {
        GtkWidget *tearoff = gtk_tearoff_menu_item_new();

        gtk_menu_append(GTK_MENU(m_menu), tearoff);
    }

    m_prevRadio = NULL;

    // append the title as the very first entry if we have it
    if ( !m_title.empty() )
    {
        Append(wxGTK_TITLE_ID, m_title);
        AppendSeparator();
    }
}
Example #6
0
void WinFrame::CreateMenuItems()
{
    menuBar_ = new wxMenuBar;

    /* Create main menu */
    auto menuMain = new wxMenu;
    {
        menuMain->Append(MENU_QUIT, "&Quit", "Quits the applications");
    }
    menuBar_->Append(menuMain, "&Main");

    /* Create compute mode menu */
    auto menuMode = new wxMenu;
    {
        menuMode->AppendRadioItem(MENU_RADIAN, "&Radian", "Sets the compute mode to radian")->Check();
        menuMode->AppendRadioItem(MENU_DEGREE, "&Degree", "Sets the compute mode to degree");
    }
    menuBar_->Append(menuMode, "&Compute Mode");

    /* Create help menu */
    auto menuHelp = new wxMenu;
    {
        menuHelp->Append(MENU_INTRO, "&Getting Started", "Shows a brief information with all supported functions and operations");
        menuHelp->Append(MENU_DEMO, "Show &Demo", "Shows the next demonstration");
        menuHelp->AppendSeparator();
        menuHelp->Append(MENU_INFO, "&About", "Shows the application information");
    }
    menuBar_->Append(menuHelp, "&Help");

    SetMenuBar(menuBar_);
}
Example #7
0
 OGLPopupDivisionMenu() : wxMenu() {
     Append(DIVISION_MENU_SPLIT_HORIZONTALLY, wxT("Split horizontally"));
     Append(DIVISION_MENU_SPLIT_VERTICALLY, wxT("Split vertically"));
     AppendSeparator();
     Append(DIVISION_MENU_EDIT_LEFT_EDGE, wxT("Edit left edge"));
     Append(DIVISION_MENU_EDIT_TOP_EDGE, wxT("Edit top edge"));
 }
Example #8
0
/**************************************************************
***
**    MyMenu   ---   addArray
***
***************************************************************/
void MyMenu::addArray( const int a[] )
{
    while( *a != -1 )
    {
        if ( *a ) addItem( *a );
        else AppendSeparator();
        *a++;
    }
}
Example #9
0
void CMenuServer::init(void)
{
    setTitle(wxT("サーバ(&S)"));
    Append(MENU_SERVER_ADD, wxT("サーバの追加"));
    Append(MENU_SERVER_DELETE, wxT("サーバの削除"));
    Append(MENU_SERVER_NICK_CHANGE, wxT("ニックネーム変更\tCTRL+N"));

    AppendSeparator();
    Append(MENU_SERVER_MOVETO_UNREAD, wxT("未読チャンネルに移動"));

}
Example #10
0
// {{{ PaneMenu::PaneMenu(ConnectionPage *parent, const wxString &title, wxAuiPaneInfoArray &panes)
PaneMenu::PaneMenu(ConnectionPage *parent, const wxString &title, wxAuiPaneInfoArray &panes) : wxMenu(title), pane(NULL), panes(panes), parent(parent) {
	for (size_t i = 0; i < panes.GetCount(); i++) {
		if (panes.Item(i).caption.Len() > 0) {
			AppendCheckItem(wxID_HIGHEST + i, panes.Item(i).caption)->Check(panes.Item(i).IsShown());
		}
	}

#ifdef PERSPECTIVE
	AppendSeparator();
	Append(wxID_SAVE, _("&Save Pane Layout"));
#endif
}
Example #11
0
void wxGISMenu::AddCommand(wxGISCommand* pCmd)
{
	switch(pCmd->GetKind())
	{
	case enumGISCommandSeparator:
		AppendSeparator();
		break;
	case enumGISCommandMenu:
		{
			wxGISCommandBar* pGISCommandBar = dynamic_cast<wxGISCommandBar*>(pCmd);
			if(pGISCommandBar)
			{
				pGISCommandBar->Reference();
				SUBMENUDATA data = {AppendSubMenu(dynamic_cast<wxMenu*>(pCmd), pCmd->GetCaption(), pCmd->GetMessage()), pGISCommandBar};
				m_SubmenuArray.push_back(data);
			}
		}
		break;
	case enumGISCommandCheck:
	case enumGISCommandRadio:
    case enumGISCommandNormal:
		{
			wxMenuItem *item = new wxMenuItem(this, pCmd->GetID(), pCmd->GetCaption(), pCmd->GetMessage(), (wxItemKind)pCmd->GetKind());
#ifdef __WIN32__
            wxBitmap Bmp = pCmd->GetBitmap();
			if(Bmp.IsOk())
            {

                wxImage Img = Bmp.ConvertToImage();                //Img.RotateHue(-0.1);
				item->SetBitmaps(Bmp, Img.ConvertToGreyscale());
            }
 #endif
			Append(item);
		}
		break;
	case enumGISCommandDropDown:
		{
			wxMenuItem *item = new wxMenuItem(this, pCmd->GetID(), pCmd->GetCaption(), pCmd->GetMessage(), (wxItemKind)enumGISCommandNormal);
#ifdef __WIN32__
			wxBitmap Bmp = pCmd->GetBitmap();
			if(Bmp.IsOk())
				item->SetBitmap(Bmp);
#endif
			Append(item);
		}
		break;
	case enumGISCommandControl:
		return;
	}
	wxGISCommandBar::AddCommand(pCmd);
}
Example #12
0
void wxMenu::Init()
{
    m_doBreak = false;
    m_allowRearrange = true;
    m_noEventsMode = false;

    m_peer = wxMenuImpl::Create( this, wxStripMenuCodes(m_title) );


    // if we have a title, insert it in the beginning of the menu
    if ( !m_title.empty() )
    {
        Append(idMenuTitle, m_title) ;
        AppendSeparator() ;
    }
}
Example #13
0
settings_menu::settings_menu(wxWindow* win, emulator_instance& _inst, int id)
	: inst(_inst)
{
	CHECK_UI_THREAD;
	parent = win;
	items[id] = NULL;
	Append(id, towxstring("All as tabs..."));
	win->Connect(id++, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(settings_menu::on_selected), NULL,
		this);
	AppendSeparator();
	for(auto i : settings_tab_factory::factories()) {
		items[id] = i;
		Append(id, towxstring(i->get_name() + "..."));
		win->Connect(id++, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(settings_menu::on_selected),
			NULL, this);
	}
}
Example #14
0
// Construct a menu with optional title (then use append)
void wxMenu::Init()
{
    // Motif-specific members
    m_numColumns = 1;
    m_menuWidget = (WXWidget) NULL;
    m_popupShell = (WXWidget) NULL;
    m_buttonWidget = (WXWidget) NULL;
    m_menuId = 0;
    m_topLevelMenu  = NULL;
    m_ownedByMenuBar = false;

    if ( !m_title.empty() )
    {
        Append(-3, m_title) ;
        AppendSeparator() ;
    }
}
Example #15
0
//
// Construct a menu with optional title (then use append)
//
void wxMenu::Init()
{
    m_bDoBreak = false;
    m_nStartRadioGroup = -1;

    //
    // Create the menu (to be used as a submenu or a popup)
    //
    if ((m_hMenu =  ::WinCreateWindow( HWND_DESKTOP
                                      ,WC_MENU
                                      ,"Menu"
                                      ,0L
                                      ,0L
                                      ,0L
                                      ,0L
                                      ,0L
                                      ,NULLHANDLE
                                      ,HWND_TOP
                                      ,0L
                                      ,NULL
                                      ,NULL
                                     )) == 0)
    {
        wxLogLastError(wxT("WinLoadMenu"));
    }
    m_vMenuData.iPosition   = 0;
    m_vMenuData.afStyle     = MIS_SUBMENU | MIS_TEXT;
    m_vMenuData.afAttribute = (USHORT)0;
    m_vMenuData.id          = m_nextMenuId++;
    m_vMenuData.hwndSubMenu = m_hMenu;
    m_vMenuData.hItem       = NULLHANDLE;

    //
    // If we have a title, insert it in the beginning of the menu
    //
    if (!m_title.empty())
    {
        Append( idMenuTitle
               ,m_title
               ,wxEmptyString
               ,wxITEM_NORMAL
              );
        AppendSeparator();
    }
} // end of wxMenu::Init
Example #16
0
// Construct a menu with optional title (then use append)
void wxMenu::Init()
{
    m_doBreak = false;
    m_startRadioGroup = -1;

    // create the menu
    m_hMenu = (WXHMENU)CreatePopupMenu();
    if ( !m_hMenu )
    {
        wxLogLastError(wxT("CreatePopupMenu"));
    }

    // if we have a title, insert it in the beginning of the menu
    if ( !m_title.empty() )
    {
        Append(idMenuTitle, m_title);
        AppendSeparator();
    }
}
Example #17
0
void wxGISToolBarMenu::Update(void)
{

	//cleare contents
    for (size_t i = 0; i < m_delitems.size(); ++i)
    {
		Destroy(m_delitems[i]);
    }
	m_delitems.clear();


	wxGISCommandBarPtrArray CommandBars = m_pApp->GetCommandBars();
	for(size_t i = 0; i < CommandBars.GetCount(); ++i)
	{
		wxGISCommandBar* pCmdBar = CommandBars[i];
		if(pCmdBar->GetType() == enumGISCBToolbar)
		{
			wxWindow* pWnd = dynamic_cast<wxWindow*>(pCmdBar);
			bool bIsShown = pWnd->IsShown();
			//TODO: sort!!!
			wxMenuItem* pItem = Prepend(ID_TOOLBARCMD + i, pCmdBar->GetCaption(), wxT(""), wxITEM_CHECK);
			pItem->Check(bIsShown);
			m_delitems.push_back(pItem);
		}
	}
	m_delitems.push_back(AppendSeparator());
	wxGISCommand* pCmd = m_pApp->GetCommand(wxT("wxGISCommonCmd"), enumGISCommonCmdCustomize);
    if (NULL != pCmd)
    {
		m_delitems.push_back(Append(pCmd->GetId(), pCmd->GetCaption(), pCmd->GetTooltip(), (wxItemKind)pCmd->GetKind()));
    }
	pCmd = m_pApp->GetCommand(wxT("wxGISCommonCmd"), enumGISCommonCmdFitToolbars);
    if (NULL != pCmd)
    {
		m_delitems.push_back(Append(pCmd->GetId(), pCmd->GetCaption(), pCmd->GetTooltip(), (wxItemKind)pCmd->GetKind()));
    }
	pCmd = m_pApp->GetCommand(wxT("wxGISCommonCmd"), enumGISCommonCmdOptimizeToolbars);
    if (NULL != pCmd)
    {
		m_delitems.push_back(Append(pCmd->GetId(), pCmd->GetCaption(), pCmd->GetTooltip(), (wxItemKind)pCmd->GetKind()));
    }
}
Example #18
0
// Construct a menu with optional title (then use append)
void wxMenu::Init()
{
    // Motif-specific members
    m_numColumns = 1;
    m_menuWidget = (WXWidget) NULL;
    m_popupShell = (WXWidget) NULL;
    m_buttonWidget = (WXWidget) NULL;
    m_menuId = 0;
    m_topLevelMenu  = (wxMenu*) NULL;
    m_ownedByMenuBar = false;

    if ( !m_title.empty() )
    {
        Append(-3, m_title) ;
        AppendSeparator() ;
    }

    m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_MENU);
    m_foregroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_MENUTEXT);
    m_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
}
Example #19
0
void wxMenu::Init()
{
    m_doBreak = false;
    m_startRadioGroup = -1;

    // create the menu
    m_macMenuId = s_macNextMenuId++;
    m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );

    if ( !m_hMenu )
    {
        wxLogLastError(wxT("UMANewMenu failed"));
    }

    wxAssociateMenuWithMacMenu( (MenuRef)m_hMenu , this ) ;

    // if we have a title, insert it in the beginning of the menu
    if ( !m_title.empty() )
    {
        Append(idMenuTitle, m_title) ;
        AppendSeparator() ;
    }
}
Example #20
0
CMakeProjectMenu::CMakeProjectMenu(CMakePlugin* plugin)
    : wxMenu()
    , m_plugin(plugin)
{
    // Open file
    Append(new wxMenuItem(this, ID_OPEN_CMAKELISTS, _("Open CMakeLists.txt")));

    AppendSeparator();

    // Export
    Append(new wxMenuItem(this, ID_EXPORT_CMAKELISTS, _("Export CMakeLists.txt")));
    Append(new wxMenuItem(this, ID_MAKE_DIRTY, _("Make dirty"),
        _("Marks CMake output files as dirty and forces cmake configuration to be call again. "
        "This is very handy when you made some changes which don't change CMakeLists.txt")
    ));

    // Binding directly to the wxMenu doesn't work
    wxTheApp->Bind(wxEVT_MENU, &CMakeProjectMenu::OnCMakeListsOpen, this, ID_OPEN_CMAKELISTS);
    wxTheApp->Bind(wxEVT_MENU, &CMakeProjectMenu::OnExport, this, ID_EXPORT_CMAKELISTS);
    wxTheApp->Bind(wxEVT_MENU, &CMakeProjectMenu::OnMakeDirty, this, ID_MAKE_DIRTY);

    wxTheApp->Bind(wxEVT_UPDATE_UI, &CMakeProjectMenu::OnFileExists, this, ID_OPEN_CMAKELISTS);
    wxTheApp->Bind(wxEVT_UPDATE_UI, &CMakeProjectMenu::OnCMakeEnabled, this, ID_MAKE_DIRTY);
}
Example #21
0
void wxGISMenu::AddCommand(ICommand* pCmd)
{
	switch(pCmd->GetKind())
	{
	case enumGISCommandSeparator:
		AppendSeparator();
		break;
	case enumGISCommandMenu:
		{
			IGISCommandBar* pGISCommandBar = dynamic_cast<IGISCommandBar*>(pCmd);
			if(pGISCommandBar)
			{
				pGISCommandBar->Reference();
				SUBMENUDATA data = {AppendSubMenu(dynamic_cast<wxMenu*>(pCmd), pCmd->GetCaption(), pCmd->GetMessage()), pGISCommandBar};
				m_SubmenuArray.push_back(data);
			}
		}
		break;
	case enumGISCommandCheck:
	case enumGISCommandRadio:
	case enumGISCommandNormal:
		{
			wxMenuItem *item = new wxMenuItem(this, pCmd->GetID(), pCmd->GetCaption(), pCmd->GetMessage(), (wxItemKind)pCmd->GetKind());
			wxBitmap Bmp = pCmd->GetBitmap();
			if(Bmp.IsOk())
				item->SetBitmaps(Bmp);//SetBitmap
			Append(item);
			//wxMenuItem* pItem = Append(pCmd->GetID(), pCmd->GetCaption(), pCmd->GetMessage(), pCmd->GetKind());
			//pItem->SetBitmaps(pCmd->GetBitmap());
		}
		break;
	case enumGISCommandControl:
		return;
	}
	wxGISCommandBar::AddCommand(pCmd);
}
Example #22
0
PlayerPanel::PlayerPanel(HINSTANCE hInstance, HWND hParent, RECT* R, ChessPieceColor NewColor)
{
  Handle = NULL;
  PlayerButton = NULL;
  PlayerMenu = NULL;

  Game = NULL;
  Color = NewColor;
  Set = NULL;
  IsReady = false;
  TooltipVisible = false;
  Height = R->bottom-R->top;
  Width = R->right-R->left;

  if (ClassAtom == 0)
  {
    /* Register the window's class */
    WNDCLASSEX WndClass;
    WndClass.cbSize = sizeof(WNDCLASSEX);
    WndClass.lpszClassName = ClassName;
    WndClass.hInstance = hInstance;
    WndClass.lpfnWndProc = PanelWindowProc;
    WndClass.style = 0;
    WndClass.hbrBackground = NULL;
    WndClass.hIcon = 0;
    WndClass.hIconSm = 0;
    WndClass.hCursor = LoadCursor(NULL,IDC_ARROW);
    WndClass.lpszMenuName = NULL;
    WndClass.cbClsExtra = 0;
    WndClass.cbWndExtra = 0;
    ClassAtom = RegisterClassEx(&WndClass);
  }
  /* Creates the window */
  if (ClassAtom != 0)
  {
    Handle = CreateWindowEx(0,ClassName,NULL,WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,
        R->top,R->bottom,Width,Height,hParent,NULL,hInstance,this);
    if (Handle != NULL)
    {
      /* Create the child windows */
      PlayerButton = CreateWindowEx(0,"BUTTON",NULL,WS_CHILD|WS_CLIPSIBLINGS|WS_TABSTOP|WS_VISIBLE,
          0,0,0,0,Handle,NULL,hInstance,NULL);
      OldPlayerButtonProc = (WNDPROC)SetWindowLong(PlayerButton,GWL_WNDPROC,(LONG)PlayerButtonProc);

      ButtonTip = CreateWindowEx(0,TOOLTIPS_CLASS,NULL,WS_POPUP|TTS_NOPREFIX,
          CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,Handle,NULL,hInstance,NULL);

      TOOLINFO toolInfo;
      toolInfo.cbSize = sizeof(toolInfo);
      toolInfo.hwnd = Handle;
      toolInfo.uFlags = TTF_IDISHWND | TTF_ABSOLUTE | TTF_TRACK;
      toolInfo.uId = (UINT_PTR)PlayerButton;
      toolInfo.hinst = hInstance;
      toolInfo.lpszText = new char[MAX_PATH];
      LoadString(hInstance, IDS_TOOLTIP_PLAYERBUTTON, toolInfo.lpszText, MAX_PATH);
      SendMessage(ButtonTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);

      /* Initialize child window placement */
      ApplyThemeToCustomButton(Handle);
      UpdateSize(Width, Height);

      /* Change the window's appearance */
      HFONT Font = EasyCreateFont(NULL,DefaultSystemFont,10,fsBold);
      PostMessage(PlayerButton,WM_SETFONT,(WPARAM)Font,FALSE);

      /* Create the popup menu */
      PlayerMenu = CreatePopupMenu();
      AppendMenu(PlayerMenu,Color == White ? IDS_PLAYERMENU_JOINASWHITE : IDS_PLAYERMENU_JOINASBLACK);
      AppendMenu(PlayerMenu,IDS_PLAYERMENU_LEAVE);
      AppendSeparator(PlayerMenu);
      AppendMenu(PlayerMenu,IDS_PLAYERMENU_READY);

      /* Set the menu items default state */
      EnableMenuItem(PlayerMenu,Color == White ? IDS_PLAYERMENU_JOINASWHITE : IDS_PLAYERMENU_JOINASBLACK,MF_BYCOMMAND|MF_GRAYED);
      EnableMenuItem(PlayerMenu,IDS_PLAYERMENU_LEAVE,MF_BYCOMMAND|MF_GRAYED);
      EnableMenuItem(PlayerMenu,IDS_PLAYERMENU_READY,MF_BYCOMMAND|MF_GRAYED);
    }
  }
}
Example #23
0
// -----------------------------------------------------------------------------
// Sets up the wxWidgets window layout
// -----------------------------------------------------------------------------
void MainWindow::setupLayout()
{
	// Create the wxAUI manager & related things
	aui_mgr_ = new wxAuiManager(this);
	aui_mgr_->SetArtProvider(new SAuiDockArt());
	wxAuiPaneInfo p_inf;

	// Set icon
	auto icon_filename = App::path(App::iconFile(), App::Dir::Temp);
	App::archiveManager().programResourceArchive()->entry(App::iconFile())->exportFile(icon_filename);
	SetIcon(wxIcon(icon_filename, wxBITMAP_TYPE_ICO));
	wxRemoveFile(icon_filename);


	// -- Editor Area --
	stc_tabs_ = new STabCtrl(this, true, true, tabs_condensed ? 27 : 31, true, true);

	// Setup panel info & add panel
	p_inf.CenterPane();
	p_inf.Name("editor_area");
	p_inf.PaneBorder(false);
	aui_mgr_->AddPane(stc_tabs_, p_inf);

	// Create Start Page
	start_page_ = new SStartPage(stc_tabs_);
	if (show_start_page)
	{
		stc_tabs_->AddPage(start_page_, "Start Page");
		stc_tabs_->SetPageBitmap(0, Icons::getIcon(Icons::General, "logo"));
		start_page_->init();
		createStartPage();
	}
	else
		start_page_->Show(false);

	// -- Console Panel --
	auto panel_console = new ConsolePanel(this, -1);

	// Setup panel info & add panel
	p_inf.DefaultPane();
	p_inf.Float();
	p_inf.FloatingSize(WxUtils::scaledSize(600, 400));
	p_inf.FloatingPosition(WxUtils::scaledPoint(100, 100));
	p_inf.MinSize(WxUtils::scaledSize(-1, 192));
	p_inf.Show(false);
	p_inf.Caption("Console");
	p_inf.Name("console");
	aui_mgr_->AddPane(panel_console, p_inf);


	// -- Archive Manager Panel --
	panel_archivemanager_ = new ArchiveManagerPanel(this, stc_tabs_);

	// Setup panel info & add panel
	p_inf.DefaultPane();
	p_inf.Left();
	p_inf.BestSize(WxUtils::scaledSize(192, 480));
	p_inf.Caption("Archive Manager");
	p_inf.Name("archive_manager");
	p_inf.Show(true);
	p_inf.Dock();
	aui_mgr_->AddPane(panel_archivemanager_, p_inf);


	// -- Undo History Panel --
	panel_undo_history_ = new UndoManagerHistoryPanel(this, nullptr);

	// Setup panel info & add panel
	p_inf.DefaultPane();
	p_inf.Right();
	p_inf.BestSize(WxUtils::scaledSize(128, 480));
	p_inf.Caption("Undo History");
	p_inf.Name("undo_history");
	p_inf.Show(false);
	p_inf.Dock();
	aui_mgr_->AddPane(panel_undo_history_, p_inf);


	// -- Menu bar --
	auto menu = new wxMenuBar();
	menu->SetThemeEnabled(false);

	// File menu
	auto file_new_menu = new wxMenu("");
	SAction::fromId("aman_newwad")->addToMenu(file_new_menu, "&Wad Archive");
	SAction::fromId("aman_newzip")->addToMenu(file_new_menu, "&Zip Archive");
	SAction::fromId("aman_newmap")->addToMenu(file_new_menu, "&Map");
	auto file_menu = new wxMenu("");
	file_menu->AppendSubMenu(file_new_menu, "&New", "Create a new Archive");
	SAction::fromId("aman_open")->addToMenu(file_menu);
	SAction::fromId("aman_opendir")->addToMenu(file_menu);
	file_menu->AppendSeparator();
	SAction::fromId("aman_save")->addToMenu(file_menu);
	SAction::fromId("aman_saveas")->addToMenu(file_menu);
	SAction::fromId("aman_saveall")->addToMenu(file_menu);
	file_menu->AppendSubMenu(panel_archivemanager_->getRecentMenu(), "&Recent Files");
	file_menu->AppendSeparator();
	SAction::fromId("aman_close")->addToMenu(file_menu);
	SAction::fromId("aman_closeall")->addToMenu(file_menu);
	file_menu->AppendSeparator();
	SAction::fromId("main_exit")->addToMenu(file_menu);
	menu->Append(file_menu, "&File");

	// Edit menu
	auto editor_menu = new wxMenu("");
	SAction::fromId("main_undo")->addToMenu(editor_menu);
	SAction::fromId("main_redo")->addToMenu(editor_menu);
	editor_menu->AppendSeparator();
	SAction::fromId("main_setbra")->addToMenu(editor_menu);
	SAction::fromId("main_preferences")->addToMenu(editor_menu);
	menu->Append(editor_menu, "E&dit");

	// View menu
	auto view_menu = new wxMenu("");
	SAction::fromId("main_showam")->addToMenu(view_menu);
	SAction::fromId("main_showconsole")->addToMenu(view_menu);
	SAction::fromId("main_showundohistory")->addToMenu(view_menu);
	SAction::fromId("main_showstartpage")->addToMenu(view_menu);
	toolbar_menu_ = new wxMenu();
	view_menu->AppendSubMenu(toolbar_menu_, "Toolbars");
	menu->Append(view_menu, "&View");

	// Tools menu
	auto tools_menu = new wxMenu("");
	SAction::fromId("main_runscript")->addToMenu(tools_menu);
	menu->Append(tools_menu, "&Tools");

	// Help menu
	auto help_menu = new wxMenu("");
	SAction::fromId("main_onlinedocs")->addToMenu(help_menu);
	SAction::fromId("main_about")->addToMenu(help_menu);
#ifdef __WXMSW__
	SAction::fromId("main_updatecheck")->addToMenu(help_menu);
#endif
	menu->Append(help_menu, "&Help");

	// Set the menu
	SetMenuBar(menu);



	// -- Toolbars --
	toolbar_ = new SToolBar(this, true);

	// Create File toolbar
	auto tbg_file = new SToolBarGroup(toolbar_, "_File");
	tbg_file->addActionButton("aman_newwad");
	tbg_file->addActionButton("aman_newzip");
	tbg_file->addActionButton("aman_open");
	tbg_file->addActionButton("aman_opendir");
	tbg_file->addActionButton("aman_save");
	tbg_file->addActionButton("aman_saveas");
	tbg_file->addActionButton("aman_saveall");
	tbg_file->addActionButton("aman_close");
	tbg_file->addActionButton("aman_closeall");
	toolbar_->addGroup(tbg_file);

	// Create Archive toolbar
	auto tbg_archive = new SToolBarGroup(toolbar_, "_Archive");
	tbg_archive->addActionButton("arch_newentry");
	tbg_archive->addActionButton("arch_newdir");
	tbg_archive->addActionButton("arch_importfiles");
	tbg_archive->addActionButton("arch_texeditor");
	tbg_archive->addActionButton("arch_mapeditor");
	tbg_archive->addActionButton("arch_run");
	toolbar_->addGroup(tbg_archive);

	// Create Entry toolbar
	auto tbg_entry = new SToolBarGroup(toolbar_, "_Entry");
	tbg_entry->addActionButton("arch_entry_rename");
	tbg_entry->addActionButton("arch_entry_delete");
	tbg_entry->addActionButton("arch_entry_import");
	tbg_entry->addActionButton("arch_entry_export");
	tbg_entry->addActionButton("arch_entry_moveup");
	tbg_entry->addActionButton("arch_entry_movedown");
	toolbar_->addGroup(tbg_entry);

	// Create Base Resource Archive toolbar
	auto tbg_bra = new SToolBarGroup(toolbar_, "_Base Resource", true);
	auto brc     = new BaseResourceChooser(tbg_bra);
	tbg_bra->addCustomControl(brc);
	tbg_bra->addActionButton("main_setbra", "settings");
	toolbar_->addGroup(tbg_bra);

	// Create Palette Chooser toolbar
	auto tbg_palette = new SToolBarGroup(toolbar_, "_Palette", true);
	palette_chooser_ = new PaletteChooser(tbg_palette, -1);
	palette_chooser_->selectPalette(global_palette);
	tbg_palette->addCustomControl(palette_chooser_);
	toolbar_->addGroup(tbg_palette);

	// Archive and Entry toolbars are initially disabled
	toolbar_->enableGroup("_archive", false);
	toolbar_->enableGroup("_entry", false);

	// Add toolbar
	aui_mgr_->AddPane(
		toolbar_,
		wxAuiPaneInfo()
			.Top()
			.CaptionVisible(false)
			.MinSize(-1, SToolBar::getBarHeight())
			.Resizable(false)
			.PaneBorder(false)
			.Name("toolbar"));

	// Populate the 'View->Toolbars' menu
	populateToolbarsMenu();
	toolbar_->enableContextMenu();

	// -- Status Bar --
	CreateStatusBar(3);


	// Load previously saved perspective string
	loadLayout();

	// Finalize
	aui_mgr_->Update();
	Layout();

	// Bind events
	Bind(wxEVT_SIZE, &MainWindow::onSize, this);
	Bind(wxEVT_CLOSE_WINDOW, &MainWindow::onClose, this);
	Bind(wxEVT_AUINOTEBOOK_PAGE_CHANGED, &MainWindow::onTabChanged, this);
	Bind(wxEVT_STOOLBAR_LAYOUT_UPDATED, &MainWindow::onToolBarLayoutChanged, this, toolbar_->GetId());
	Bind(wxEVT_ACTIVATE, &MainWindow::onActivate, this);
	Bind(wxEVT_AUINOTEBOOK_PAGE_CLOSE, [&](wxAuiNotebookEvent& e) {
		// Null start_page pointer if start page tab is closed
		auto page = stc_tabs_->GetPage(stc_tabs_->GetSelection());
		if (page->GetName() == "startpage")
			start_page_ = nullptr;
	});

	// Initial focus to toolbar
	toolbar_->SetFocus();
}