Ejemplo n.º 1
0
wxExSTCEntryDialog::wxExSTCEntryDialog(wxWindow* parent,
  const wxString& caption,
  const wxString& text,
  const wxString& prompt,
  long button_style,
  bool use_shell,
  wxWindowID id,
  const wxPoint& pos,
  const wxSize& size, 
  long style,
  const wxString& name)
  : wxExDialog(parent, caption, button_style, id, pos, size, style, name)
  , m_Process(NULL)
{
  if (!prompt.empty())
  {
    AddUserSizer(CreateTextSizer(prompt), wxSizerFlags().Center());
  }

  wxPersistentRegisterAndRestore(this);

  m_STC =  (use_shell ?
    new wxExSTCShell(this, text, wxEmptyString, true, -1, wxEmptyString, wxExSTC::STC_MENU_DEFAULT):
    new wxExSTC(this, text));
  
  m_STC->SetEdgeMode(wxSTC_EDGE_NONE);
  m_STC->ResetMargins();
  m_STC->SetViewEOL(false);
  m_STC->SetViewWhiteSpace(wxSTC_WS_INVISIBLE);

  AddUserSizer(m_STC);

  LayoutSizers();
}
Ejemplo n.º 2
0
DisplayVariableDlg::DisplayVariableDlg( wxWindow* parent)
    : clDebuggerTipWindowBase( parent )
    , m_debugger(NULL)
    , m_keepCurrentPosition(false)
    , m_dragging(false)
    , m_editDlgIsUp(false)
{
    Hide();
    Centre();
    MSWSetNativeTheme(m_treeCtrl);
    m_timer2 = new wxTimer(this);
    m_mousePosTimer = new wxTimer(this);

    SetName("clDebuggerEditItemDlgBase");
    
    bool sizeSet(false);
    if (!wxPersistenceManager::Get().Find(this)) {
        sizeSet = wxPersistentRegisterAndRestore(this, "CLDebuggerTip");
    }
    wxUnusedVar(sizeSet);
    if (GetSize().x < 100 || GetSize().y < 100 ) {
        SetSize( wxRect(GetPosition(), wxSize(100, 100) ) );
    }

    Connect(m_timer2->GetId(),        wxEVT_TIMER, wxTimerEventHandler(DisplayVariableDlg::OnTimer2), NULL, this);
    Connect(m_mousePosTimer->GetId(), wxEVT_TIMER, wxTimerEventHandler(DisplayVariableDlg::OnCheckMousePosTimer), NULL, this);
    m_panelStatusBar->Connect(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(DisplayVariableDlg::OnCaptureLost), NULL, this);
}
Ejemplo n.º 3
0
wxExFrame::wxExFrame(wxWindow* parent,
                     wxWindowID id,
                     const wxString& title,
                     long style)
    : wxFrame(parent, id, title, wxDefaultPosition, wxDefaultSize, style, "wxExFrame")
    , m_FindReplaceDialog(NULL)
    , m_MenuBar(NULL)
    , m_FindFocus(NULL)
    , m_IsCommand(false)
{
    Initialize();

    wxPersistentRegisterAndRestore(this);

#if wxUSE_HTML & wxUSE_PRINTING_ARCHITECTURE
    wxExPrinting::Get()->GetHtmlPrinter()->SetParentWindow(this);
#endif
}
Ejemplo n.º 4
0
bool MainFrame::Create(wxDocManager* docManager, const wxString& title)
{
    bool ok = wxDocMDIParentFrame::Create(docManager, NULL, wxID_ANY, title);

    if (ok)
    {
        SetIcon(wxICON(text));

        wxMenu* menu;
        
        menu = new wxMenu();
        menu->Append(wxID_NEW);
        menu->Append(wxID_OPEN);
        menu->AppendSeparator();
        menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT) + wxT("\t") + _("Ctrl+Q"));

        docManager->FileHistoryUseMenu(menu);
        docManager->FileHistoryLoad(*wxConfig::Get());

        wxMenuBar* menubar = new wxMenuBar();

        menubar->Append(menu, wxGetStockLabel(wxID_FILE));

        menu = new wxMenu();
        menu->Append(wxID_ABOUT, wxGetStockLabel(wxID_ABOUT) + wxT("\t") + _("Shift+F1"));
        menubar->Append(menu, wxGetStockLabel(wxID_HELP));

        SetMenuBar(menubar);
        CreateStatusBar();
    #ifdef _WX_PERSIST_H_
        if (!wxPersistentRegisterAndRestore(this, wxT("Main")))
    #endif
        {
            wxFrame_SetInitialPosition(this);
        }
        this->Connect(wxEVT_CLOSE_WINDOW,
                      wxCloseEventHandler(MainFrame::OnCloseWindow));
    }
    return ok;
}
Ejemplo n.º 5
0
ManagerFrame::ManagerFrame( wxWindow* parent ):
	BaseManagerFrame(parent),
	m_replayProvider(NULL)
{
	SetTitle(wxTheApp->GetAppDisplayName());
	SetStatusBar(m_statusBar);

#ifdef __WXMSW__
	SetIcon(wxIcon("APPICON"));
#endif

	// Initalize default size / position
	SetMinClientSize(wxDLG_UNIT(this, wxSize(200, 100)));
	SetClientSize(wxDLG_UNIT(this, wxSize(480, 280)));
	m_treeSplitter->SetSashPosition(wxDLG_UNIT(this, wxSize(120, -1)).GetWidth());
	int sashHeight = GetClientSize().GetHeight() - m_toolBar->GetSize().GetHeight() - wxDLG_UNIT(this, wxSize(-1, 80)).GetHeight();
	m_splitter->SetSashPosition(sashHeight);
	Center();

	// Disconnect wxFormBuilder idle events
	m_treeSplitter->Disconnect(wxEVT_IDLE, wxIdleEventHandler(BaseManagerFrame::m_treeSplitterOnIdle), NULL, this);
	m_splitter->Disconnect(wxEVT_IDLE, wxIdleEventHandler(BaseManagerFrame::m_splitterOnIdle), NULL, this);

	wxPersistentRegisterAndRestore(this);
	wxPersistentRegisterAndRestore(m_treeSplitter);
	wxPersistentRegisterAndRestore(m_splitter);

	m_providerDV->AppendIconTextColumn(_("Category"), PCIDescription, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(80, -1)).GetWidth());

	wxSizeEvent sizeEvt;
	OnProviderSizeChanged(sizeEvt);

	m_replayDV->AppendTextColumn(_("Arena"), RCIArena, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(80, -1)).GetWidth())->SetFlags(wxCOL_DEFAULT_FLAGS | wxCOL_SORTABLE);
	m_replayDV->AppendTextColumn(_("Team Size"), RCITeamSize, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(20, -1)).GetWidth(), wxALIGN_RIGHT)->SetFlags(wxCOL_DEFAULT_FLAGS | wxCOL_SORTABLE);
	m_replayDV->AppendTextColumn(_("Score"), RCIScore, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth(), wxALIGN_CENTER)->SetFlags(wxCOL_DEFAULT_FLAGS | wxCOL_SORTABLE);
	m_replayDV->AppendTextColumn(_("Length"), RCILength, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth())->SetFlags(wxCOL_DEFAULT_FLAGS | wxCOL_SORTABLE);
	wxDataViewColumn* dateColumn = m_replayDV->AppendTextColumn(_("Date"), RCIDate, wxDATAVIEW_CELL_INERT, wxDLG_UNIT(this, wxSize(60, -1)).GetWidth());
	dateColumn->SetFlags(wxCOL_DEFAULT_FLAGS | wxCOL_SORTABLE);
	dateColumn->SetSortOrder(false);
	m_replayDV->AppendTextColumn(_("Description"), RCIDescription);

	m_goalListCtrl->AppendColumn(_("Player"), wxLIST_FORMAT_CENTER, wxDLG_UNIT(this, wxSize(80, -1)).GetWidth());
	m_goalListCtrl->AppendColumn(_("Score"), wxLIST_FORMAT_CENTER, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_goalListCtrl->AppendColumn(_("Team"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(20, -1)).GetWidth());
	m_goalListCtrl->AppendColumn(_("Time"), wxLIST_FORMAT_LEFT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());

	m_statsListCtrl->AppendColumn(_("Player"), wxLIST_FORMAT_LEFT, wxDLG_UNIT(this, wxSize(80, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Score"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Goals"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Saves"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Assists"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Shots on Goal"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(28, -1)).GetWidth());
	m_statsListCtrl->AppendColumn(_("Team"), wxLIST_FORMAT_RIGHT, wxDLG_UNIT(this, wxSize(20, -1)).GetWidth());

	wxFileName basePath(wxStandardPaths::Get().GetDocumentsDir(), "");
	basePath.AppendDir("My Games");
	basePath.AppendDir("Rocket League");
	basePath.AppendDir("TAGame");
	basePath.AppendDir("Demos");

	// Prepare various UI elements
	m_menubar->Check(ID_AUTO_UPLOAD, wxConfig::Get()->ReadBool("AutoUpload", false));
	m_toolBar->EnableTool(ID_EXPORT, false);
	m_toolBar->EnableTool(ID_UPLOAD, false);
	m_toolBar->EnableTool(wxID_DELETE, false);

	ReplayProvider::Ptr activeReplays(new ReplayProvider(&m_replayProvider, basePath.GetFullPath(), "Active Game Replays"));
	m_replayProvider.provider.push_back(activeReplays);
	if (activeReplays->replay.empty())
		wxLogError(_("No replays could be found"));

	ReplayProvider::Ptr archiveRoot(new ReplayProvider(&m_replayProvider, "", "Replay Archive"));
	m_replayProvider.provider.push_back(archiveRoot);

	wxObjectDataPtr<ProviderDataModel> provModel(new ProviderDataModel(&m_replayProvider));
	m_providerDV->AssociateModel(provModel.get());

	m_providerDV->Select(wxDataViewItem(activeReplays.get()));
	wxDataViewEvent dvEvt;
	dvEvt.SetItem(wxDataViewItem(activeReplays.get()));
	OnProviderSelectionChanged(dvEvt);

	m_replayDV->SetFocus();

	m_menubar->Enable(ID_NEW_CATEGORY, false);
	m_toolBar->EnableTool(ID_NEW_CATEGORY, false);

	m_replayProvider.Bind(wxEVT_REPLAY_ADDED, &ManagerFrame::OnReplayAdded, this);
	m_replayProvider.Bind(wxEVT_REPLAY_REMOVED, &ManagerFrame::OnReplayRemoved, this);
	TransferManager::Get().Bind(wxEVT_TRANSFER_UPDATE, &ManagerFrame::OnTransferUpdate, this);

	m_replayDV->SetDropTarget(new ReplayDropTarget(m_replayDV));
}
Ejemplo n.º 6
0
wxExSTCEntryDialog::wxExSTCEntryDialog(wxWindow* parent,
  const wxString& caption,
  const wxString& text,
  const wxString& prompt,
  long button_style,
  bool use_shell,
  wxWindowID id,
  const wxPoint& pos,
  const wxSize& size, 
  long style,
  const wxString& name)
  : wxExDialog(parent, caption, button_style, id, pos, size, style, name)
  , m_Process(NULL)
{
#if wxUSE_STATTEXT
  if (!prompt.empty())
  {
    // See wxWidgets: src\generic\textdlgg.cpp, use similar bottom border flags.
    AddUserSizer(CreateTextSizer(prompt), 
      wxSizerFlags().DoubleBorder(wxBOTTOM));
  }
#endif

  wxPersistentRegisterAndRestore(this);

  m_STC = (use_shell ?
    new wxExSTCShell(this, text, wxEmptyString, true, -1, wxEmptyString,
      wxExSTC::STC_MENU_DEFAULT | wxExSTC::STC_MENU_OPEN_LINK):
    new wxExSTC(this, text));
  
  m_STC->SetEdgeMode(wxSTC_EDGE_NONE);
  m_STC->ResetMargins();
  m_STC->SetViewEOL(false);
  m_STC->SetViewWhiteSpace(wxSTC_WS_INVISIBLE);

  AddUserSizer(m_STC);

  LayoutSizers();
  
  Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& event){
    if (m_Process != NULL)
    {
      if (m_Process->IsRunning())
      {
        m_Process->Kill();
      }
    }});

  Bind(wxEVT_BUTTON, [=](wxCommandEvent& event) {
      if (m_Process != NULL)
      {
        if (m_Process->IsRunning())
        {
          m_Process->Kill();
        }
      }
      event.Skip();}, wxID_OK);
  
  Bind(wxEVT_MENU, [=](wxCommandEvent& event) {
      wxPostEvent(wxTheApp->GetTopWindow(), event);}, wxID_FIND);
  Bind(wxEVT_MENU, [=](wxCommandEvent& event) {
      wxPostEvent(wxTheApp->GetTopWindow(), event);}, wxID_REPLACE);
}