示例#1
0
ManagerFrame::ManagerFrame() :
    wxFrame(NULL, -1, _("Poedit - Catalogs manager"),
            wxDefaultPosition, wxDefaultSize,
            wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE,
            "manager")
{
#if defined(__WXGTK__)
    wxIconBundle appicons;
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(16,16)));
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(32,32)));
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(48,48)));
    SetIcons(appicons);
#elif defined(__WXMSW__)
    SetIcons(wxIconBundle(wxStandardPaths::Get().GetResourcesDir() + "\\Resources\\Poedit.ico"));
#endif

    ms_instance = this;

    auto tb = wxXmlResource::Get()->LoadToolBar(this, "manager_toolbar");
    (void)tb;
#ifdef __WXMSW__
    // De-uglify the toolbar a bit on Windows 10:
    if (IsWindows10OrGreater())
    {
        const wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
        if (theme)
        {
            wxUxThemeHandle hTheme(tb, L"ExplorerMenu::Toolbar");
            tb->SetBackgroundColour(wxRGBToColour(theme->GetThemeSysColor(hTheme, COLOR_WINDOW)));
        }
    }
#endif

    wxPanel *panel = wxXmlResource::Get()->LoadPanel(this, "manager_panel");

    m_listPrj = XRCCTRL(*panel, "prj_list", wxListBox);
    m_listCat = XRCCTRL(*panel, "prj_files", wxListCtrl);
    m_splitter = XRCCTRL(*panel, "manager_splitter", wxSplitterWindow);

    wxImageList *list = new wxImageList(PX(16), PX(16));
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-no"));
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-mid"));
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-ok"));
    m_listCat->AssignImageList(list, wxIMAGE_LIST_SMALL);

    m_curPrj = -1;

    int last = (int)wxConfig::Get()->Read("manager_last_selected", (long)0);

    // FIXME: do this in background (here and elsewhere)
    UpdateListPrj(last);
    if (m_listPrj->GetCount() > 0)
        UpdateListCat(last);

    RestoreWindowState(this, wxSize(PX(400), PX(300)));

    m_splitter->SetSashPosition((int)wxConfig::Get()->Read("manager_splitter", PX(200)));
}
示例#2
0
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    gdk_window_set_decorations(gtk_widget_get_window(m_widget),
                               (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(gtk_widget_get_window(m_widget),
                               (GdkWMFunction)m_gdkFunc);

    // GTK's shrinking/growing policy
    if ( !(m_gdkFunc & GDK_FUNC_RESIZE) )
        gtk_window_set_resizable(GTK_WINDOW(m_widget), FALSE);
#ifndef __WXGTK3__
    else
        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
#endif

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);

#ifdef __WXGTK3__
    if (gtk_window_get_has_resize_grip(GTK_WINDOW(m_widget)))
    {
        // Grip window can end up obscured, probably due to deferred show.
        // Reset grip to ensure it is visible.
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), false);
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), true);
    }
#endif
}
示例#3
0
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    GdkWindow* window = gtk_widget_get_window(m_widget);

    gdk_window_set_decorations(window, (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(window, (GdkWMFunction)m_gdkFunc);

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);

    GdkCursor* cursor = g_globalCursor.GetCursor();
    if (wxIsBusy() && !gtk_window_get_modal(GTK_WINDOW(m_widget)))
        cursor = g_busyCursor.GetCursor();

    if (cursor)
        gdk_window_set_cursor(window, cursor);

#ifdef __WXGTK3__
    if (gtk_window_get_has_resize_grip(GTK_WINDOW(m_widget)))
    {
        // Grip window can end up obscured, probably due to deferred show.
        // Reset grip to ensure it is visible.
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), false);
        gtk_window_set_has_resize_grip(GTK_WINDOW(m_widget), true);
    }
#endif
}
示例#4
0
PqwxFrame::PqwxFrame(const wxString& title)
  : wxFrame(NULL, wxID_ANY, title), titlePrefix(title), currentEditor(NULL), haveCurrentServer(false)
{
#ifdef __WXMSW__
  SetIcon(wxIcon(_T("Pqwx_appicon")));
#else
  wxIconBundle icons;
  icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-64.png")));
  icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-48.png")));
  icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-32.png")));
  icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-16.png")));
  SetIcons(icons);
#endif

  SetMenuBar(wxXmlResource::Get()->LoadMenuBar(_T("mainmenu")));

  wxSplitterWindow *mainSplitter = new wxSplitterWindow(this, wxID_ANY);

  PushEventHandler(&(::wxGetApp().GetObjectBrowserModel()));
  objectBrowserModelTimer = new wxTimer(&(::wxGetApp().GetObjectBrowserModel()), ObjectBrowserModel::TIMER_MAINTAIN);
  objectBrowserModelTimer->Start(30 * 1000, wxTIMER_CONTINUOUS); // 30 seconds

  objectBrowser = new ObjectBrowser(::wxGetApp().GetObjectBrowserModel(), mainSplitter, Pqwx_ObjectBrowser);
  documentsBook = new DocumentsNotebook(mainSplitter, Pqwx_DocumentsNotebook);
  mainSplitter->SplitVertically(objectBrowser, documentsBook);
  mainSplitter->SetSashGravity(0.2);
  mainSplitter->SetMinimumPaneSize(100);

  LoadFrameGeometry();

  mainSplitter->SetSashPosition(GetSize().GetWidth()/4);
}
示例#5
0
GSFrame::GSFrame( const wxString& title)
	: wxFrame(NULL, wxID_ANY, title, g_Conf->GSWindow.WindowPos)
	, m_timer_UpdateTitle( this )
{
	SetIcons( wxGetApp().GetIconBundle() );
	SetBackgroundColour( *wxBLACK );

	wxStaticText* label = new wxStaticText( this, wxID_ANY, _("GS Output is Disabled!") );
	m_id_OutputDisabled = label->GetId();
	label->SetFont( pxGetFixedFont( 20, wxFONTWEIGHT_BOLD ) );
	label->SetForegroundColour( *wxWHITE );

	AppStatusEvent_OnSettingsApplied();

	GSPanel* gsPanel = new GSPanel( this );
	gsPanel->Show( !EmuConfig.GS.DisableOutput );
	m_id_gspanel = gsPanel->GetId();

	// TODO -- Implement this GS window status window!  Whee.
	// (main concern is retaining proper client window sizes when closing/re-opening the window).
	//m_statusbar = CreateStatusBar( 2 );

	Bind(wxEVT_CLOSE_WINDOW, &GSFrame::OnCloseWindow, this);
	Bind(wxEVT_MOVE, &GSFrame::OnMove, this);
	Bind(wxEVT_SIZE, &GSFrame::OnResize, this);
	Bind(wxEVT_ACTIVATE, &GSFrame::OnActivate, this);

	Bind(wxEVT_TIMER, &GSFrame::OnUpdateTitle, this, m_timer_UpdateTitle.GetId());
}
示例#6
0
NetPlayDialog::NetPlayDialog(wxWindow* const parent, const CGameListCtrl* const game_list,
                             const std::string& game, const bool is_hosting)
    : wxFrame(parent, wxID_ANY, _("Dolphin NetPlay")), m_selected_game(game), m_start_btn(nullptr),
      m_host_label(nullptr), m_host_type_choice(nullptr), m_host_copy_btn(nullptr),
      m_host_copy_btn_is_retry(false), m_is_hosting(is_hosting), m_game_list(game_list)
{
  Bind(wxEVT_THREAD, &NetPlayDialog::OnThread, this);
  CreateGUI();
  SetIcons(WxUtils::GetDolphinIconBundle());
  Center();

  // Remember the window size and position for NetWindow
  {
    IniFile inifile;
    inifile.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
    IniFile::Section& netplay_section = *inifile.GetOrCreateSection("NetPlay");

    int winPosX, winPosY, winWidth, winHeight;
    netplay_section.Get("NetWindowPosX", &winPosX, std::numeric_limits<int>::min());
    netplay_section.Get("NetWindowPosY", &winPosY, std::numeric_limits<int>::min());
    netplay_section.Get("NetWindowWidth", &winWidth, -1);
    netplay_section.Get("NetWindowHeight", &winHeight, -1);

    WxUtils::SetWindowSizeAndFitToScreen(this, wxPoint(winPosX, winPosY),
                                         wxSize(winWidth, winHeight), GetSize());
  }
}
AnimationReversePlayActionUI::AnimationReversePlayActionUI(ViewerActionLogic *L) :
    ViewerActionUIToggle(L)
{
    SetAllText(tr("Reverse play"));
    SetToolTip(tr("Play animation in reverse"));
    if (!GetViewerProperties()->GetNowin())
        SetIcons(QPixmap(animationreverseplayon_xpm), QPixmap(animationreverseplayoff_xpm));
}
AnimationStopActionUI::AnimationStopActionUI(ViewerActionLogic *L) :
    ViewerActionUIToggle(L)
{
    SetAllText(tr("Stop"));
    SetToolTip(tr("Stop animation"));
    if (!GetViewerProperties()->GetNowin())
        SetIcons(QPixmap(animationstopon_xpm), QPixmap(animationstopoff_xpm));
}
示例#9
0
文件: toplvcmn.cpp 项目: mark711/Cafu
void wxTopLevelWindowBase::SetIcon(const wxIcon& icon)
{
    // passing wxNullIcon to SetIcon() is possible (it means that we shouldn't
    // have any icon), but adding an invalid icon to wxIconBundle is not
    wxIconBundle icons;
    if ( icon.IsOk() )
        icons.AddIcon(icon);

    SetIcons(icons);
}
示例#10
0
// Create: builds the GUI components.
bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
                             const wxString& WXUNUSED(title), int style
#if wxUSE_CONFIG
                             , wxConfigBase *config, const wxString& rootpath
#endif // wxUSE_CONFIG
                            )
{
    m_HtmlHelpWin = new wxHtmlHelpWindow(m_Data);
    m_HtmlHelpWin->SetController(m_helpController);
#if wxUSE_CONFIG
    if ( config )
        m_HtmlHelpWin->UseConfig(config, rootpath);
#endif // wxUSE_CONFIG

    wxFrame::Create(parent, id, _("Help"),
                    wxPoint(m_HtmlHelpWin->GetCfgData().x, m_HtmlHelpWin->GetCfgData().y),
                    wxSize(m_HtmlHelpWin->GetCfgData().w, m_HtmlHelpWin->GetCfgData().h),
                    wxDEFAULT_FRAME_STYLE, wxT("wxHtmlHelp"));
#if wxUSE_STATUSBAR
    CreateStatusBar();
#endif
    m_HtmlHelpWin->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                          wxTAB_TRAVERSAL|wxNO_BORDER, style);

    GetPosition(& (m_HtmlHelpWin->GetCfgData().x), & (m_HtmlHelpWin->GetCfgData()).y);

    SetIcons(wxArtProvider::GetIconBundle(wxART_HELP, wxART_FRAME_ICON));

    // On the Mac, each modeless frame must have a menubar.
    // TODO: add more menu items, and perhaps add a style to show
    // the menubar: compulsory on the Mac, optional elsewhere.
#ifdef __WXMAC__
    wxMenuBar* menuBar = new wxMenuBar;

    wxMenu* fileMenu = new wxMenu;
    fileMenu->Append(wxID_HTML_OPENFILE, _("&Open..."));
    fileMenu->AppendSeparator();
    fileMenu->Append(wxID_CLOSE, _("&Close"));

    wxMenu* helpMenu = new wxMenu;
    helpMenu->Append(wxID_ABOUT, _("&About"));
    // Ensures we don't get an empty help menu
    helpMenu->Append(wxID_HELP_CONTENTS, _("&About"));

    menuBar->Append(fileMenu,_("&File"));
    menuBar->Append(helpMenu,_("&Help"));
    SetMenuBar(menuBar);
#endif

    m_HtmlHelpWin->GetHtmlWindow()->SetRelatedFrame(this, m_TitleFormat);
#if wxUSE_STATUSBAR
    m_HtmlHelpWin->GetHtmlWindow()->SetRelatedStatusBar(0);
#endif
    return true;
}
示例#11
0
CreditsDialog::CreditsDialog(wxWindow* parent,wxString title,int whichIcon) : wxDialog(parent,-1,title,wxDefaultPosition,
			wxDefaultSize,wxDEFAULT_DIALOG_STYLE|wxFRAME_FLOAT_ON_PARENT)
{
	wxBoxSizer* container = new wxBoxSizer(wxVERTICAL);
	text_ctrl = new wxTextCtrl(this,-1,wxEmptyString,wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE|wxTE_READONLY|wxTE_RICH);
	container->Add(text_ctrl,1,wxEXPAND);

	container->Add(wxDialog::CreateButtonSizer(wxOK));
	SetSizer(container);
	wxIcon icon = getIcon( whichIcon);
	SetIcons(icon);
}
示例#12
0
BOOL CXTPPopupItem::SetIcons(UINT nIDBitmap, COLORREF clrTransparent, int itemIcon)
{
    BOOL bAlphaBitmap = FALSE;

    HBITMAP hBitmap = CXTPImageManagerIcon::LoadBitmapFromResource(MAKEINTRESOURCE(nIDBitmap), &bAlphaBitmap);
    if (!hBitmap)
        return FALSE;

    BOOL res =  SetIcons(hBitmap, clrTransparent, itemIcon, bAlphaBitmap);

    DeleteObject(hBitmap);

    return res;
}
void CASW_VGUI_Computer_Menu::ASWInit()
{
	SetPaintBackgroundType(0);
	SetPaintBackgroundEnabled(false);
	SetBgColor( Color(0,0,0,0) );
	
	SetAlpha(255);
	SetIcons();
	m_pBlackBar[0]->SetImage("swarm/HUD/ASWHUDBlackBar");
	m_pBlackBar[1]->SetImage("swarm/HUD/ASWHUDBlackBar");

	m_pAccessDeniedLabel->SetAlpha(0);
	m_pInsufficientRightsLabel->SetAlpha(0);
}
TailFrameBase::TailFrameBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCB60EInitBitmapResources();
        bBitmapLoaded = true;
    }
    // Set icon(s) to the application/dialog
    wxIconBundle app_icons;
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("16-find"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("16-find@2x"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    SetIcons( app_icons );

    
    wxBoxSizer* boxSizer37 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer37);
    
    SetName(wxT("TailFrameBase"));
    SetSize(500,300);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    this->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(TailFrameBase::OnClose), NULL, this);
    
}
void CASW_VGUI_Computer_Menu::ShowMenu()
{
	// if the computer is locked, don't show the menu, instead show our 'terminal secure' message
	C_ASW_Computer_Area *pArea = m_pHackComputer->GetComputerArea();
	if (!pArea)
		return;

	if (pArea->IsLocked())
	{
		//todo: show labels (+and red background?)
		vgui::GetAnimationController()->RunAnimationCommand(m_pAccessDeniedLabel, "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
		vgui::GetAnimationController()->RunAnimationCommand(m_pInsufficientRightsLabel, "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);			
		int x,y,w,h;
		GetBounds(x,y,w,h);
		vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[0], "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
		vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[1], "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
		vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[0], "tall", m_fScale*ASW_BLACK_BAR_HEIGHT, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
		vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[1], "ypos", h  - m_fScale*ASW_BLACK_BAR_HEIGHT*0.8f, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
		m_pBlackBar[1]->SetTall(m_fScale*ASW_BLACK_BAR_HEIGHT*0.8f+1);	
		// make sure the background is red
		CASW_VGUI_Computer_Frame* pFrame = dynamic_cast<CASW_VGUI_Computer_Frame*>(GetParent());
		if (pFrame)
			pFrame->SetBackdrop(1);
		CLocalPlayerFilter filter;
		C_BaseEntity::EmitSound( filter, -1 /*SOUND_FROM_LOCAL_PLAYER*/, "ASWComputer.AccessDenied" );
		return;
	}
	// make sure the background is blue
	CASW_VGUI_Computer_Frame* pFrame = dynamic_cast<CASW_VGUI_Computer_Frame*>(GetParent());
	if (pFrame)
		pFrame->SetBackdrop(0);
	SetIcons();
	LayoutMenuOptions();
	// fade them in
	for (int i=0;i<m_iOptions;i++)
	{
		vgui::GetAnimationController()->RunAnimationCommand(m_pMenuLabel[i], "Alpha", 255, 0.2f * i, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
		vgui::GetAnimationController()->RunAnimationCommand(m_pMenuIcon[i], "Alpha", 255, 0.2f * i, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
		vgui::GetAnimationController()->RunAnimationCommand(m_pMenuIconShadow[i], "Alpha", 30, 0.2f * i, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);		
	}
	int x,y,w,h;
	GetBounds(x,y,w,h);
	vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[0], "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
	vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[1], "Alpha", 255, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
	vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[0], "tall", m_fScale*ASW_BLACK_BAR_HEIGHT, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
	vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[1], "ypos", h  - m_fScale*ASW_BLACK_BAR_HEIGHT*0.8f, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);
	m_pBlackBar[1]->SetTall(m_fScale*ASW_BLACK_BAR_HEIGHT*0.8f+1);
	//vgui::GetAnimationController()->RunAnimationCommand(m_pBlackBar[1], "tall", m_fScale*ASW_BLACK_BAR_HEIGHT*0.8f+1, 0, 1.0f, vgui::AnimationController::INTERPOLATOR_LINEAR);	
}
示例#16
0
void PWUpdaterFrame::CreateControls()
{
    /* icons */
    wxIconBundle icons;
    icons.AddIcon(wxIcon(ruby_16_xpm));
    icons.AddIcon(wxIcon(ruby_32_xpm));
    icons.AddIcon(wxIcon(ruby_48_xpm));
    SetIcons(icons);

    /* menu bar */
    wxMenu *file_menu = new wxMenu;
    file_menu->Append(wxID_EXIT, _("&Quit"), _("Quit this program."));
    wxMenu *view_menu = new wxMenu;
    view_menu->AppendCheckItem(myID_MBAR_VIEW_LOG, _("Log Message\tCTRL+F1"), _("Show or hide the log message."));
    view_menu->AppendSeparator();
    view_menu->Append(wxID_PREFERENCES, _("&Preferences"), _("Modify user configuration."));
    wxMenu *help_menu = new wxMenu;
    help_menu->Append(wxID_ABOUT, _("&About"), _("About this program."));

    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append(file_menu, _("&File"));
    menuBar->Append(view_menu, _("&View"));
    menuBar->Append(help_menu, _("&Help"));
    SetMenuBar(menuBar);

    /* tool bar */

    /* status bar */
    wxStatusBar *statBar = new wxStatusBar(this, myID_FRAME_STATUSBAR, wxSTB_DEFAULT_STYLE);
    int stBarWidths[STATBAR_FLD_MAX] = { -1, -3 };
    statBar->SetFieldsCount(STATBAR_FLD_MAX);
    statBar->SetStatusWidths(STATBAR_FLD_MAX, stBarWidths);
    SetStatusBar(statBar);

    /* aui manager & panes */
    _auiMgr.SetManagedWindow(this);
    _auiMgr.SetFlags(_auiMgr.GetFlags() | wxAUI_MGR_LIVE_RESIZE);

    _auiMgr.AddPane(new LogPane(this),
        wxAuiPaneInfo().Name(PANE_NAME_LOG).Caption(_("Log Window")).
        CloseButton(true).DestroyOnClose(false).MinSize(750, 120).
        Bottom().LeftDockable(false).RightDockable(false).TopDockable(false).
        Hide());
    _auiMgr.AddPane(new DownloadPane(this, myID_PANE_DOWNLOAD),
        wxAuiPaneInfo().Name(PANE_NAME_DOWNLOAD).CaptionVisible(false).
        CenterPane().CloseButton(false).DestroyOnClose(false));

    _auiMgr.Update();
}
示例#17
0
frmOdaGet::frmOdaGet(wxTopLevelWindow* parent, wxWindowID id, wxString SaveLocation)
 : m_SaveLocation(SaveLocation)
{
    wxXmlResource::Get()->LoadFrame(this, parent, wxT("frmOdaGet"));

    if (parent)
    {
        SetIcons(parent->GetIcons());
    }

    m_HTTPThread = NULL;
    m_FTPThread = NULL;

    m_DownloadURL = XRCCTRL(*this, "m_DownloadURL", wxTextCtrl);
    m_LocationDisplay = XRCCTRL(*this, "m_LocationDisplay", wxTextCtrl);
    m_DownloadGauge = XRCCTRL(*this, "m_DownloadGauge", wxGauge);
}
示例#18
0
ManagerFrame::ManagerFrame() :
    wxFrame(NULL, -1, _("Poedit - Catalogs manager"),
            wxDefaultPosition, wxDefaultSize,
            wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE,
            "manager")
{
#if defined(__WXGTK__)
    wxIconBundle appicons;
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(16,16)));
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(32,32)));
    appicons.AddIcon(wxArtProvider::GetIcon("poedit", wxART_FRAME_ICON, wxSize(48,48)));
    SetIcons(appicons);
#elif defined(__WXMSW__)
    SetIcon(wxICON(appicon));
#endif

    ms_instance = this;

    wxXmlResource::Get()->LoadToolBar(this, "manager_toolbar");
    wxXmlResource::Get()->LoadMenuBar(this, "manager_menu");

    wxPanel *panel = wxXmlResource::Get()->LoadPanel(this, "manager_panel");

    m_listPrj = XRCCTRL(*panel, "prj_list", wxListBox);
    m_listCat = XRCCTRL(*panel, "prj_files", wxListCtrl);
    m_splitter = XRCCTRL(*panel, "manager_splitter", wxSplitterWindow);

    wxImageList *list = new wxImageList(16, 16);
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-no"));
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-mid"));
    list->Add(wxArtProvider::GetBitmap("poedit-status-cat-ok"));
    m_listCat->AssignImageList(list, wxIMAGE_LIST_SMALL);

    m_curPrj = -1;

    int last = (int)wxConfig::Get()->Read("manager_last_selected", (long)0);

    // FIXME: do this in background (here and elsewhere)
    UpdateListPrj(last);
    if (m_listPrj->GetCount() > 0)
        UpdateListCat(last);

    RestoreWindowState(this, wxSize(400, 300));

    m_splitter->SetSashPosition(wxConfig::Get()->Read("manager_splitter", 200));
}
示例#19
0
wxDropSource::wxDropSource(wxWindow *win,
                           const wxIcon &iconCopy,
                           const wxIcon &iconMove,
                           const wxIcon &iconNone)
{
    m_waiting = true;

    m_iconWindow = (GtkWidget*) NULL;

    m_window = win;
    m_widget = win->m_widget;
    if (win->m_wxwindow) m_widget = win->m_wxwindow;

    m_retValue = wxDragCancel;

    SetIcons(iconCopy, iconMove, iconNone);
}
示例#20
0
bool wxSTEditorFrame::Create(wxWindow *parent, wxWindowID id,
                             const wxString& title,
                             const wxPoint& pos, const wxSize& size,
                             long  style,
                             const wxString& name)
{
    m_titleBase = title;

    if (!wxFrame::Create(parent, id, title, pos, size, style, name))
        return false;

    // Set the frame's icons
    SetIcons(wxSTEditorArtProvider::GetDialogIconBundle());

    ::wxFrame_SetInitialPosition(this, pos, size);

    return true;
}
示例#21
0
MainFrame::MainFrame(void) : wxFrame(NULL, wxID_ANY, _("Omega Online Registry Editor")),
	m_fileHistory(8)
{
	wxIconBundle icon_bundle;
	icon_bundle.AddIcon(wxIcon(icon_large));
	icon_bundle.AddIcon(wxIcon(icon_small));

	SetIcons(icon_bundle);

	m_bKeys = false;
	m_bValues = false;
	m_bData = false;
	m_bMatchAll = false;
	m_bIgnoreCase = false;

	CreateChildWindows();
	CreateMenus();
}
示例#22
0
bool CDlgMessages::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    CSkinAdvanced*         pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
    wxASSERT(pSkinAdvanced);
    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));

        
    SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);

    wxDialog::Create( parent, id, caption, pos, size, style );

    wxString strCaption = caption;
    if (strCaption.IsEmpty()) {
        strCaption.Printf(_("%s - Notices"), pSkinAdvanced->GetApplicationName().c_str());
    }
    SetTitle(strCaption);

    // Initialize Application Icon
    SetIcons(*pSkinAdvanced->GetApplicationIcon());

    Freeze();

    SetBackgroundStyle(wxBG_STYLE_CUSTOM);

#if TEST_BACKGROUND_WITH_MAGENTA_FILL
    SetBackgroundColour(wxColour(255, 0, 255));
#endif
    SetForegroundColour(*wxBLACK);

    CreateControls();

    GetSizer()->Fit(this);
    GetSizer()->SetSizeHints(this);

    // To work properly on Mac, RestoreState() must be called _after_ 
    //  calling GetSizer()->Fit(), GetSizer()->SetSizeHints() and Center()
    RestoreState();   

    Thaw();

    return true;
}
示例#23
0
wxDropSource::wxDropSource(wxDataObject& data,
                           wxWindow *win,
                           const wxIcon &iconCopy,
                           const wxIcon &iconMove,
                           const wxIcon &iconNone)
{
    m_waiting = true;

    SetData( data );

    m_iconWindow = NULL;

    m_window = win;
    m_widget = win->m_widget;
    if (win->m_wxwindow) m_widget = win->m_wxwindow;

    m_retValue = wxDragCancel;

    SetIcons(iconCopy, iconMove, iconNone);
}
示例#24
0
void wxTopLevelWindowGTK::GTKHandleRealized()
{
    wxNonOwnedWindow::GTKHandleRealized();

    gdk_window_set_decorations(gtk_widget_get_window(m_widget),
                               (GdkWMDecoration)m_gdkDecor);
    gdk_window_set_functions(gtk_widget_get_window(m_widget),
                               (GdkWMFunction)m_gdkFunc);

    // GTK's shrinking/growing policy
    if ( !(m_gdkFunc & GDK_FUNC_RESIZE) )
        gtk_window_set_resizable(GTK_WINDOW(m_widget), FALSE);
#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
    else
        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
#endif

    const wxIconBundle& icons = GetIcons();
    if (icons.GetIconCount())
        SetIcons(icons);
}
示例#25
0
settings_frame::settings_frame(wxWindow *parent, const wxString &title, wxWindowID id)
	: wxFrame(parent, id, title ),
	WindowAttributesPickle( _T("SETTINGSFRAME"), this, wxSize( DEFSETT_SW_WIDTH, DEFSETT_SW_HEIGHT ) ),
	simpleTab(0),
	uiTab(0),
	audioTab(0),
	detailTab(0),
	qualityTab(0),
	hotkeyTab(0),
	settingsIcon( new wxIcon(springsettings_xpm) ),
	m_has_focus(true)
{
	SetIcons( SLcustomizations().GetAppIconBundle() );

	alreadyCalled = false;
	parentWindow = parent;

	if ( !usync().IsLoaded() )
        usync().ReloadUnitSyncLib();

	notebook = new wxNotebook(this, ID_OPTIONS);
//	notebook->SetFont(wxFont(8, wxSWISS, wxNORMAL,wxNORMAL, false, _T("Tahoma")));


    if (abstract_panel::loadValuesIntoMap())
	{
		CreateGUIControls();
		initMenuBar();
	}
	else
	{
		notebook->AddPage(new PathOptionPanel(notebook,this),_("Error!"));
	}

     Layout();
     Center();

     if ( !parentWindow ) 	UpdateMainAppHasFocus(m_has_focus); // only do if not being a slave of main SL app
}
示例#26
0
FaceFrame::FaceFrame()
	: wxFrame(NULL, -1, _T("XFaceEd"), wxDefaultPosition, wxSize(1024, 768)), m_dictionaryDlg(0)
{
	wxFileSystem::AddHandler(new wxZipFSHandler);
	m_help.AddBook(wxFileName(_T("./help.zip")));
	
	wxImage::AddHandler(new wxPNGHandler());
    wxIcon icon;
	bool test = icon.LoadFile(_T("./res/XFaceLogo.ico"), wxBITMAP_TYPE_ICO );
	SetIcons(wxIconBundle(icon));
	// set the frame icon
//	SetIcon(icon);

	SetStatusBar(CreateStatusBar(2));

	createMenu();
	
    m_splitter = new Splitter(this);
	
	try{
		m_GLwnd = new FaceView(m_splitter);
		m_GLwnd->Refresh();
		Mediator::getInstance()->regFaceView(m_GLwnd);
	}
	catch(...)
	{
		wxMessageBox(_T("Unable to create OpenGL window, you might have a problem with your video card drivers!"), _T("Exception"));
		Close(true);
	}
	
	m_panel = new LeftPanel(m_splitter, 0, 0, 350, 768);
	m_panel->InitDialog();
    m_splitter->SplitVertically(m_panel, m_GLwnd, 350);
	//m_splitter->SetMinimumPaneSize(300);

	SetDropTarget(new DropFDPFileTarget);

	SetTitle(_T("XfaceEd - No file loaded!"));
}
示例#27
0
GSFrame::GSFrame( const wxString& title)
	: wxFrame(NULL, wxID_ANY, title, g_Conf->GSWindow.WindowPos)
	, m_timer_UpdateTitle( this )
{
	SetIcons( wxGetApp().GetIconBundle() );
	SetBackgroundColour( *wxBLACK );

	AppStatusEvent_OnSettingsApplied();

	GSPanel* gsPanel = new GSPanel( this );
	m_id_gspanel = gsPanel->GetId();

	// TODO -- Implement this GS window status window!  Whee.
	// (main concern is retaining proper client window sizes when closing/re-opening the window).
	//m_statusbar = CreateStatusBar( 2 );

	Bind(wxEVT_CLOSE_WINDOW, &GSFrame::OnCloseWindow, this);
	Bind(wxEVT_MOVE, &GSFrame::OnMove, this);
	Bind(wxEVT_SIZE, &GSFrame::OnResize, this);
	Bind(wxEVT_ACTIVATE, &GSFrame::OnActivate, this);

	Bind(wxEVT_TIMER, &GSFrame::OnUpdateTitle, this, m_timer_UpdateTitle.GetId());
}
示例#28
0
MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC9ED9InitBitmapResources();
        bBitmapLoaded = true;
    }
    // Set icon(s) to the application/dialog
    wxIconBundle app_icons;
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-16"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("terminal-32"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    SetIcons( app_icons );

    
    wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer1);
    
    m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(800,600), wxTAB_TRAVERSAL);
    
    boxSizer1->Add(m_mainPanel, 1, wxEXPAND, 5);
    
    wxBoxSizer* boxSizer11 = new wxBoxSizer(wxVERTICAL);
    m_mainPanel->SetSizer(boxSizer11);
    
    m_stc = new wxStyledTextCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0);
    #ifdef __WXMSW__
    // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE
    wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #else
    wxFont m_stcFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT);
    m_stcFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #endif
    m_stc->SetFont(m_stcFont);
    m_stc->SetFocus();
    // Configure the fold margin
    m_stc->SetMarginType     (4, wxSTC_MARGIN_SYMBOL);
    m_stc->SetMarginMask     (4, wxSTC_MASK_FOLDERS);
    m_stc->SetMarginSensitive(4, true);
    m_stc->SetMarginWidth    (4, 0);
    
    // Configure the tracker margin
    m_stc->SetMarginWidth(1, 0);
    
    // Configure the symbol margin
    m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL);
    m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS));
    m_stc->SetMarginWidth(2, 16);
    m_stc->SetMarginSensitive(2, true);
    
    // Configure the line numbers margin
    m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER);
    m_stc->SetMarginWidth(0,0);
    
    // Configure the line symbol margin
    m_stc->SetMarginType(3, wxSTC_MARGIN_FORE);
    m_stc->SetMarginMask(3, 0);
    m_stc->SetMarginWidth(3,0);
    // Select the lexer
    m_stc->SetLexer(wxSTC_LEX_NULL);
    // Set default font / styles
    m_stc->StyleClearAll();
    for(int i=0; i<wxSTC_STYLE_MAX; ++i) {
        m_stc->StyleSetFont(i, m_stcFont);
    }
    m_stc->SetWrapMode(0);
    m_stc->SetIndentationGuides(0);
    m_stc->SetKeyWords(0, wxT(""));
    m_stc->SetKeyWords(1, wxT(""));
    m_stc->SetKeyWords(2, wxT(""));
    m_stc->SetKeyWords(3, wxT(""));
    m_stc->SetKeyWords(4, wxT(""));
    
    boxSizer11->Add(m_stc, 1, wxALL|wxEXPAND, 0);
    
    m_menuBar = new wxMenuBar(0);
    this->SetMenuBar(m_menuBar);
    
    m_File = new wxMenu();
    m_menuBar->Append(m_File, _("File"));
    
    m_menuItemSave = new wxMenuItem(m_File, wxID_SAVE, _("Save...\tCtrl-S"), wxT(""), wxITEM_NORMAL);
    m_File->Append(m_menuItemSave);
    
    m_menuItemClear = new wxMenuItem(m_File, wxID_CLEAR, _("Clear View\tCtrl-L"), wxT(""), wxITEM_NORMAL);
    m_File->Append(m_menuItemClear);
    
    m_File->AppendSeparator();
    
    m_menuItemPreferences = new wxMenuItem(m_File, wxID_PREFERENCES, _("Preferences..."), wxT(""), wxITEM_NORMAL);
    m_File->Append(m_menuItemPreferences);
    
    m_File->AppendSeparator();
    
    m_menuItem7 = new wxMenuItem(m_File, wxID_EXIT, _("Exit\tAlt-X"), _("Quit"), wxITEM_NORMAL);
    m_File->Append(m_menuItem7);
    
    m_Signals = new wxMenu();
    m_menuBar->Append(m_Signals, _("Signals"));
    
    m_menuItemINT = new wxMenuItem(m_Signals, ID_SIGINT, _("SIGINT"), wxT(""), wxITEM_NORMAL);
    m_Signals->Append(m_menuItemINT);
    
    m_menuItemTERM = new wxMenuItem(m_Signals, ID_SIGTERM, _("SIGTERM"), wxT(""), wxITEM_NORMAL);
    m_Signals->Append(m_menuItemTERM);
    
    m_menuItemKILL = new wxMenuItem(m_Signals, ID_SIGKILL, _("SIGKILL"), wxT(""), wxITEM_NORMAL);
    m_Signals->Append(m_menuItemKILL);
    
    m_menuItemHUP = new wxMenuItem(m_Signals, ID_SIGHUP, _("SIGHUP"), wxT(""), wxITEM_NORMAL);
    m_Signals->Append(m_menuItemHUP);
    
    m_Help = new wxMenu();
    m_menuBar->Append(m_Help, _("Help"));
    
    m_menuItem9 = new wxMenuItem(m_Help, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL);
    m_Help->Append(m_menuItem9);
    
    m_timerMarker = new wxTimer;
    m_timerMarker->Start(50, false);
    
    SetName(wxT("MainFrameBaseClass"));
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    CentreOnParent(wxBOTH);
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    this->Connect(wxEVT_IDLE, wxIdleEventHandler(MainFrameBaseClass::OnIdle), NULL, this);
    m_stc->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainFrameBaseClass::OnKeyDown), NULL, this);
    m_stc->Connect(wxEVT_STC_UPDATEUI, wxStyledTextEventHandler(MainFrameBaseClass::OnStcUpdateUI), NULL, this);
    this->Connect(m_menuItemClear->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnClearView), NULL, this);
    this->Connect(m_menuItemPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSettings), NULL, this);
    this->Connect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this);
    this->Connect(m_menuItemINT->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this);
    this->Connect(m_menuItemTERM->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this);
    this->Connect(m_menuItemKILL->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this);
    this->Connect(m_menuItemHUP->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnSignal), NULL, this);
    this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this);
    m_timerMarker->Connect(wxEVT_TIMER, wxTimerEventHandler(MainFrameBaseClass::OnAddMarker), NULL, this);
    
}
示例#29
0
NodeJSDebuggerDlgBase::NodeJSDebuggerDlgBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCD9C6InitBitmapResources();
        bBitmapLoaded = true;
    }
    // Set icon(s) to the application/dialog
    wxIconBundle app_icons;
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("nodejs"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("nodejs-32"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    SetIcons( app_icons );

    
    wxBoxSizer* boxSizer68 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer68);
    
    wxFlexGridSizer* flexGridSizer76 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer76->SetFlexibleDirection( wxBOTH );
    flexGridSizer76->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    flexGridSizer76->AddGrowableCol(1);
    
    boxSizer68->Add(flexGridSizer76, 0, wxALL|wxEXPAND, 5);
    
    m_staticText78 = new wxStaticText(this, wxID_ANY, _("Node.js executable:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    flexGridSizer76->Add(m_staticText78, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_filePickerNodeJS = new wxFilePickerCtrl(this, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*"), wxDefaultPosition, wxSize(-1,-1), wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL|wxFLP_SMALL);
    m_filePickerNodeJS->SetToolTip(_("Select Node.js executable"));
    m_filePickerNodeJS->SetFocus();
    
    flexGridSizer76->Add(m_filePickerNodeJS, 0, wxALL|wxEXPAND, 5);
    
    m_staticTextScript = new wxStaticText(this, wxID_ANY, _("Script to debug:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    flexGridSizer76->Add(m_staticTextScript, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_filePickerScript = new wxFilePickerCtrl(this, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*"), wxDefaultPosition, wxSize(-1,-1), wxFLP_DEFAULT_STYLE|wxFLP_USE_TEXTCTRL|wxFLP_SMALL);
    m_filePickerScript->SetToolTip(_("Select the script to execute"));
    
    flexGridSizer76->Add(m_filePickerScript, 0, wxALL|wxEXPAND, 5);
    
    m_staticTextDebuggerPort = new wxStaticText(this, wxID_ANY, _("Debugger port:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    flexGridSizer76->Add(m_staticTextDebuggerPort, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    m_textCtrlPort = new wxTextCtrl(this, wxID_ANY, wxT("5858"), wxDefaultPosition, wxSize(-1,-1), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textCtrlPort->SetHint(wxT(""));
    #endif
    
    flexGridSizer76->Add(m_textCtrlPort, 0, wxALL|wxEXPAND, 5);
    
    m_staticText132 = new wxStaticText(this, wxID_ANY, _("Command line arguments:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    boxSizer68->Add(m_staticText132, 0, wxALL, 5);
    
    m_stcCommandLineArguments = new wxStyledTextCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), 0);
    m_stcCommandLineArguments->SetToolTip(_("Pass command line arguments to Node.js\nPlace each argument on its own line"));
    // Configure the fold margin
    m_stcCommandLineArguments->SetMarginType     (4, wxSTC_MARGIN_SYMBOL);
    m_stcCommandLineArguments->SetMarginMask     (4, wxSTC_MASK_FOLDERS);
    m_stcCommandLineArguments->SetMarginSensitive(4, true);
    m_stcCommandLineArguments->SetMarginWidth    (4, 0);
    
    // Configure the tracker margin
    m_stcCommandLineArguments->SetMarginWidth(1, 0);
    
    // Configure the symbol margin
    m_stcCommandLineArguments->SetMarginType (2, wxSTC_MARGIN_SYMBOL);
    m_stcCommandLineArguments->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS));
    m_stcCommandLineArguments->SetMarginWidth(2, 0);
    m_stcCommandLineArguments->SetMarginSensitive(2, true);
    
    // Configure the line numbers margin
    m_stcCommandLineArguments->SetMarginType(0, wxSTC_MARGIN_NUMBER);
    m_stcCommandLineArguments->SetMarginWidth(0,0);
    
    // Configure the line symbol margin
    m_stcCommandLineArguments->SetMarginType(3, wxSTC_MARGIN_FORE);
    m_stcCommandLineArguments->SetMarginMask(3, 0);
    m_stcCommandLineArguments->SetMarginWidth(3,0);
    // Select the lexer
    m_stcCommandLineArguments->SetLexer(wxSTC_LEX_NULL);
    // Set default font / styles
    m_stcCommandLineArguments->StyleClearAll();
    m_stcCommandLineArguments->SetWrapMode(0);
    m_stcCommandLineArguments->SetIndentationGuides(0);
    m_stcCommandLineArguments->SetKeyWords(0, wxT(""));
    m_stcCommandLineArguments->SetKeyWords(1, wxT(""));
    m_stcCommandLineArguments->SetKeyWords(2, wxT(""));
    m_stcCommandLineArguments->SetKeyWords(3, wxT(""));
    m_stcCommandLineArguments->SetKeyWords(4, wxT(""));
    
    boxSizer68->Add(m_stcCommandLineArguments, 1, wxALL|wxEXPAND, 5);
    
    m_stdBtnSizer70 = new wxStdDialogButtonSizer();
    
    boxSizer68->Add(m_stdBtnSizer70, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10);
    
    m_buttonOK = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonOK->SetDefault();
    m_stdBtnSizer70->AddButton(m_buttonOK);
    
    m_button74 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
    m_stdBtnSizer70->AddButton(m_button74);
    m_stdBtnSizer70->Realize();
    
    SetName(wxT("NodeJSDebuggerDlgBase"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_buttonOK->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(NodeJSDebuggerDlgBase::OnOKUI), NULL, this);
    
}
示例#30
0
FindInFilesDialogBase::FindInFilesDialogBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCABC4InitBitmapResources();
        bBitmapLoaded = true;
    }
    // Set icon(s) to the application/dialog
    wxIconBundle app_icons;
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("find-in-files"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon( icn );
    }
    SetIcons( app_icons );

    
    wxBoxSizer* boxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    this->SetSizer(boxSizer7);
    
    m_panelMainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    
    boxSizer7->Add(m_panelMainPanel, 1, wxEXPAND, 5);
    
    wxBoxSizer* boxSizer50 = new wxBoxSizer(wxHORIZONTAL);
    m_panelMainPanel->SetSizer(boxSizer50);
    
    wxFlexGridSizer* fgSizer41 = new wxFlexGridSizer(0, 2, 0, 0);
    fgSizer41->SetFlexibleDirection( wxBOTH );
    fgSizer41->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    fgSizer41->AddGrowableCol(1);
    fgSizer41->AddGrowableRow(2);
    
    boxSizer50->Add(fgSizer41, 1, wxALL|wxEXPAND, 5);
    
    m_staticText1 = new wxStaticText(m_panelMainPanel, wxID_ANY, _("Find What :"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_staticText1, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    wxArrayString m_findStringArr;
    m_findString = new wxComboBox(m_panelMainPanel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), m_findStringArr, 0);
    m_findString->SetToolTip(_("String to search"));
    m_findString->SetFocus();
    #if wxVERSION_NUMBER >= 3000
    m_findString->SetHint(_("Type a string to search..."));
    #endif
    
    fgSizer41->Add(m_findString, 0, wxALL|wxEXPAND, 5);
    
    m_staticText2 = new wxStaticText(m_panelMainPanel, wxID_ANY, _("Look in :"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_staticText2, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    wxBoxSizer* bSizer10 = new wxBoxSizer(wxHORIZONTAL);
    
    fgSizer41->Add(bSizer10, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_dirPicker = new DirPicker(m_panelMainPanel, wxID_ANY, wxT("..."), wxEmptyString, _("Select a folder:"), wxDefaultPosition, wxDefaultSize, wxDP_USE_COMBOBOX);
    bSizer10->Add(m_dirPicker, 1, wxALL, 5);
    
    m_btnAddPath = new wxButton(m_panelMainPanel, wxID_ANY, _("&Add"), wxDefaultPosition, wxSize(-1, -1), wxBU_EXACTFIT);
    
    bSizer10->Add(m_btnAddPath, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    fgSizer41->Add(0, 0, 0, wxEXPAND, 5);
    
    wxBoxSizer* bSizer9 = new wxBoxSizer(wxHORIZONTAL);
    
    fgSizer41->Add(bSizer9, 0, wxEXPAND, 5);
    
    wxArrayString m_listPathsArr;
    m_listPaths = new wxListBox(m_panelMainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), m_listPathsArr, 0);
    
    bSizer9->Add(m_listPaths, 1, wxLEFT|wxTOP|wxBOTTOM|wxEXPAND, 5);
    
    wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL);
    
    bSizer9->Add(boxSizer1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 5);
    
    m_btnRemovelPath = new wxButton(m_panelMainPanel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), wxBU_EXACTFIT);
    #if wxVERSION_NUMBER >= 2904
    m_btnRemovelPath->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("clear-all")), wxLEFT);
    m_btnRemovelPath->SetBitmapMargins(2,2);
    #endif
    m_btnRemovelPath->SetToolTip(_("Remove the selected search path"));
    
    boxSizer1->Add(m_btnRemovelPath, 0, wxTOP|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_btnClearPaths = new wxButton(m_panelMainPanel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), wxBU_EXACTFIT);
    #if wxVERSION_NUMBER >= 2904
    m_btnClearPaths->SetBitmap(wxXmlResource::Get()->LoadBitmap(wxT("delete-line")), wxLEFT);
    m_btnClearPaths->SetBitmapMargins(2,2);
    #endif
    m_btnClearPaths->SetToolTip(_("Clear the search path list"));
    
    boxSizer1->Add(m_btnClearPaths, 0, wxTOP|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_staticText3 = new wxStaticText(m_panelMainPanel, wxID_ANY, _("File Mask:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_staticText3, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    wxArrayString m_fileTypesArr;
    m_fileTypesArr.Add(wxT("*.c;*.cpp;*.cxx;*.cc;*.h;*.hpp;*.inc;*.mm;*.m;*.xrc"));
    m_fileTypes = new wxComboBox(m_panelMainPanel, wxID_ANY, wxT("*.c;*.cpp;*.cxx;*.cc;*.h;*.hpp;*.inc;*.mm;*.m;*.xrc"), wxDefaultPosition, wxSize(-1, -1), m_fileTypesArr, 0);
    m_fileTypes->SetToolTip(_("Search these file types"));
    #if wxVERSION_NUMBER >= 3000
    m_fileTypes->SetHint(wxT(""));
    #endif
    m_fileTypes->SetSelection(0);
    
    fgSizer41->Add(m_fileTypes, 1, wxALL|wxEXPAND, 5);
    
    m_staticText5 = new wxStaticText(m_panelMainPanel, wxID_ANY, _("Files Encoding:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_staticText5, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5);
    
    wxArrayString m_choiceEncodingArr;
    m_choiceEncoding = new wxChoice(m_panelMainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), m_choiceEncodingArr, 0);
    m_choiceEncoding->SetToolTip(_("Use this file encoding when scanning files for matches"));
    
    fgSizer41->Add(m_choiceEncoding, 1, wxALL|wxEXPAND, 5);
    
    m_staticText7 = new wxStaticText(m_panelMainPanel, wxID_ANY, _("Options:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_staticText7, 0, wxALL|wxALIGN_RIGHT, 5);
    
    m_notebook1 = new wxNotebook(m_panelMainPanel, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), 0);
    
    fgSizer41->Add(m_notebook1, 0, wxALL|wxEXPAND, 5);
    
    m_panel1 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
    m_notebook1->AddPage(m_panel1, _("General"), false);
    
    wxBoxSizer* bSizer6 = new wxBoxSizer(wxVERTICAL);
    m_panel1->SetSizer(bSizer6);
    
    wxFlexGridSizer* fgSizer3 = new wxFlexGridSizer(0, 1, 0, 0);
    fgSizer3->SetFlexibleDirection( wxBOTH );
    fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    
    bSizer6->Add(fgSizer3, 0, wxALL|wxEXPAND, 5);
    
    m_matchCase = new wxCheckBox(m_panel1, wxID_ANY, _("&Match case"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_matchCase->SetValue(false);
    m_matchCase->SetToolTip(_("Toggle case sensitive search"));
    
    fgSizer3->Add(m_matchCase, 0, wxALL|wxEXPAND, 5);
    
    m_matchWholeWord = new wxCheckBox(m_panel1, wxID_ANY, _("Match &whole word"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_matchWholeWord->SetValue(false);
    m_matchWholeWord->SetToolTip(_("Toggle whole word search"));
    
    fgSizer3->Add(m_matchWholeWord, 0, wxALL|wxEXPAND, 5);
    
    m_regualrExpression = new wxCheckBox(m_panel1, wxID_ANY, _("Regular &expression"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_regualrExpression->SetValue(false);
    m_regualrExpression->SetToolTip(_("The 'Find What' field is a regular expression"));
    
    fgSizer3->Add(m_regualrExpression, 0, wxALL|wxEXPAND, 5);
    
    m_checkBoxSaveFilesBeforeSearching = new wxCheckBox(m_panel1, wxID_ANY, _("&Save modified files before searching"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxSaveFilesBeforeSearching->SetValue(false);
    m_checkBoxSaveFilesBeforeSearching->SetToolTip(_("Save any modified files before search starts"));
    
    fgSizer3->Add(m_checkBoxSaveFilesBeforeSearching, 0, wxALL|wxEXPAND, 5);
    
    m_checkBoxSeparateTab = new wxCheckBox(m_panel1, wxID_ANY, _("Display search results in separate tab"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxSeparateTab->SetValue(true);
    
    fgSizer3->Add(m_checkBoxSeparateTab, 0, wxALL, 5);
    
    m_panel2 = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
    m_notebook1->AddPage(m_panel2, _("C++"), false);
    
    wxBoxSizer* bSizer7 = new wxBoxSizer(wxVERTICAL);
    m_panel2->SetSizer(bSizer7);
    
    wxFlexGridSizer* fgSizer4 = new wxFlexGridSizer(0, 1, 0, 0);
    fgSizer4->SetFlexibleDirection( wxBOTH );
    fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    
    bSizer7->Add(fgSizer4, 0, wxEXPAND, 5);
    
    m_printScope = new wxCheckBox(m_panel2, wxID_ANY, _("Display the C++ scope of the match"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_printScope->SetValue(false);
    m_printScope->SetToolTip(_("Display the class + function name for the matches"));
    
    fgSizer4->Add(m_printScope, 0, wxALL, 5);
    
    m_checkBoxSkipMatchesFoundInComments = new wxCheckBox(m_panel2, wxID_ANY, _("Hide matches found in comments"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxSkipMatchesFoundInComments->SetValue(false);
    
    fgSizer4->Add(m_checkBoxSkipMatchesFoundInComments, 0, wxALL, 5);
    
    m_checkBoxSkipMatchesFoundInStrings = new wxCheckBox(m_panel2, wxID_ANY, _("Hide matches found inside strings"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxSkipMatchesFoundInStrings->SetValue(false);
    
    fgSizer4->Add(m_checkBoxSkipMatchesFoundInStrings, 0, wxALL, 5);
    
    m_checkBoxHighlighStringComments = new wxCheckBox(m_panel2, wxID_ANY, _("Use different colour for matches found in comments"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_checkBoxHighlighStringComments->SetValue(false);
    
    fgSizer4->Add(m_checkBoxHighlighStringComments, 0, wxALL, 5);
    
    fgSizer41->Add(0, 0, 0, wxBOTTOM|wxEXPAND, 10);
    
    wxBoxSizer* bSizer2 = new wxBoxSizer(wxVERTICAL);
    
    boxSizer50->Add(bSizer2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_find = new wxButton(m_panelMainPanel, wxID_FIND, _("&Find"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_find->SetDefault();
    m_find->SetToolTip(_("Begin search"));
    
    bSizer2->Add(m_find, 0, wxALL|wxEXPAND, 5);
    
    m_replaceAll = new wxButton(m_panelMainPanel, wxID_REPLACE, _("&Replace"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_replaceAll->SetToolTip(_("Search for matches and place them in the 'Replace' window as candidates for possible replace operation"));
    
    bSizer2->Add(m_replaceAll, 0, wxALL|wxEXPAND, 5);
    
    m_stop = new wxButton(m_panelMainPanel, wxID_STOP, _("Sto&p"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_stop->SetToolTip(_("Stop the current search"));
    
    bSizer2->Add(m_stop, 0, wxALL|wxEXPAND, 5);
    
    m_cancel = new wxButton(m_panelMainPanel, wxID_CANCEL, _("Close"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_cancel->SetToolTip(_("Close this dialog"));
    
    bSizer2->Add(m_cancel, 0, wxALL|wxEXPAND, 5);
    
    SetSizeHints(-1,-1);
    if ( GetSizer() ) {
         GetSizer()->Fit(this);
    }
    Centre(wxBOTH);
    // Connect events
    m_btnAddPath->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnAddPath), NULL, this);
    m_btnRemovelPath->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnRemovePath), NULL, this);
    m_btnRemovelPath->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindInFilesDialogBase::OnRemovePathUI), NULL, this);
    m_btnClearPaths->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnClearPaths), NULL, this);
    m_btnClearPaths->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindInFilesDialogBase::OnClearPathsUI), NULL, this);
    m_checkBoxHighlighStringComments->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindInFilesDialogBase::OnUseDiffColourForCommentsUI), NULL, this);
    m_find->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnFind), NULL, this);
    m_find->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindInFilesDialogBase::OnFindWhatUI), NULL, this);
    m_replaceAll->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnReplace), NULL, this);
    m_replaceAll->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(FindInFilesDialogBase::OnFindWhatUI), NULL, this);
    m_stop->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnStop), NULL, this);
    m_cancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FindInFilesDialogBase::OnButtonClose), NULL, this);
    
}