Esempio n. 1
0
void WorkspacePane::OnToggleWorkspaceTab(clCommandEvent& event)
{
    // Handle the core tabs
    if(m_tabs.count(event.GetString()) == 0) {
        event.Skip();
        return;
    }

    const Tab& t = m_tabs.find(event.GetString())->second;
    if(event.IsSelected()) {
        // Insert the page
        int where = clTabTogglerHelper::IsTabInNotebook(GetNotebook(), t.m_label);
        if(where == wxNOT_FOUND) {
            GetNotebook()->AddPage(t.m_window, t.m_label, false, t.m_bmp);
        } else {
            GetNotebook()->SetSelection(where);
        }
    } else {
        // hide the tab
        int where = GetNotebook()->GetPageIndex(t.m_label);
        if(where != wxNOT_FOUND) {
            GetNotebook()->RemovePage(where);
        }
    }
}
Esempio n. 2
0
/**
 * Launch the compilation of the selected source file.
 * The compilation is done with the file on disc.
 */
void CapriceIDEImpl::OnAssemble( wxCommandEvent& event)
{
  CapASM capAsm(emulator);
  std::string filename =  std::string(GetNotebook()->GetEditor()->GetFileName().GetFullName().mb_str());
  capAsm.Compile( filename.c_str());

}
Esempio n. 3
0
void OutputPane::OnToggleTab(clCommandEvent& event)
{
    // Handle the core tabs
    if(m_tabs.count(event.GetString()) == 0) {
        event.Skip();
        return;
    }

    const Tab& t = m_tabs.find(event.GetString())->second;
    if(event.IsSelected()) {
        // Insert the page
        GetNotebook()->InsertPage(0, t.m_window, t.m_label, true, t.m_bmp);
    } else {
        // hide the tab
        int where = GetNotebook()->GetPageIndex(t.m_label);
        if(where != wxNOT_FOUND) {
            GetNotebook()->RemovePage(where);
        }
    }
}
Esempio n. 4
0
void HtMainFrame::OnKeyDown (wxKeyEvent &event)
{
   // Keyboard shortcuts to change the current active notebook tab.
   if (event.ControlDown() && event.GetKeyCode() == WXK_TAB)
   {
      bool goForward = !event.ShiftDown();

      GetNotebook()->AdvanceSelection(goForward);
      return;
   }

   // resume default event propagation
   event.Skip();
}
Esempio n. 5
0
/**
* This method is responsible for setting everything up in the doc/view framework
* and opening the request file for editing in a new notebook tab.
* @param path Path to the filename being opened
*/
void HtMainFrame::DoOpenFile (const wxString &path)
{
   wxDocManager *docm = wxGetApp().doc_manager.get();

   // TODO: fazer as checagens no arquivo antes de tentar abrir.
   //       Ex: verificar se ele pode ser aberto como leitura/escrita, se o usuário tem permissão etc.

   // check if the requested file ain't already open
   wxList &docs = docm->GetDocuments();
   for (wxList::iterator i = docs.begin(); i != docs.end(); i++)
   {
      HexDoc *doc = dynamic_cast <HexDoc *> (*i);

      if (doc->GetFilename() == path)
      {
         // it's open already... focus it and we're done
         HexFrame *frame = static_cast<HexView *>(doc->GetFirstView())->GetFrame();

         auto *nb = GetNotebook();
         auto frmIdx = nb->FindPage(static_cast<wxWindow *>(frame));

         if (frmIdx != wxNOT_FOUND)
         {
            nb->SetSelection(frmIdx);
            frame->SetFocus();
         }

         return;
      }
   }

   // the view is created automatically when we create the doc
   HexDoc *doc = (HexDoc *)docm->CreateDocument(path, wxDOC_SILENT);

   if (doc)
   {
      HexView *view = (HexView *)doc->GetFirstView();

      HexFrame *frame = new HexFrame(view, this, wxID_ANY, wxFileNameFromPath(path));
      history.AddFileToHistory(path);

#ifdef WXDEBUG
      DebugPanel *dbgPanel = dynamic_cast<DebugPanel *>(FindWindowById(HT_DebugPanel));
      view->AddToDebugPanel(dbgPanel);
#endif
   }
   else // TODO: melhorar essa mensagem de erro.
      wxMessageBox(wxString::Format("Não foi possível abrir o arquivo\n%s", path), "Erro", wxOK | wxICON_ERROR, this);
}
Esempio n. 6
0
void MainFrame::OnInspect(wxCommandEvent& event)
{
    wxEmailMessage message;
    message.SetFrom(GetTextCtrlFrom()->GetValue())
        .SetTo(GetTextCtrlTo()->GetValue())
        .SetMessage(GetTextCtrlBody()->GetValue())
        .SetSubject(GetTextCtrlSubject()->GetValue());

    if(!GetFilePickerAttachment()->GetPath().IsEmpty()) {
        message.AddAttachment(GetFilePickerAttachment()->GetPath());
    }
    if(!GetFilePickerAttachment2()->GetPath().IsEmpty()) {
        message.AddAttachment(GetFilePickerAttachment2()->GetPath());
    }
    GetStcRaw()->SetText(message.PayLoad());
    GetNotebook()->SetSelection(1);
}
Esempio n. 7
0
void HtMainFrame::OnClose (wxCloseEvent &WXUNUSED(event))
{
#ifdef WXDEBUG
   dynamic_cast<DebugPanel *>(FindWindowById(HT_DebugPanel))->StopUpdateTimer();
#endif

   wxDocManager *docm = wxGetApp().doc_manager.get();

   wxList &docs = docm->GetDocuments();

   // delete all pages currently open in the notebook.
   // this will automatically destroy the views/doc/frames associated to them.
   wxAuiNotebook *nb = GetNotebook();
   while (nb->GetPageCount())
      nb->DeletePage(0);

   docm->Clear(true);
   Destroy();
}
Esempio n. 8
0
LibraryPanel::LibraryPanel(wxWindow* parent)
	: ee::LibraryPanel(parent)
{
	AddPage(new LibraryPage(GetNotebook()));
}
Esempio n. 9
0
LibraryPanel::LibraryPanel(wxWindow* parent)
	: ee::LibraryPanel(parent)
{
	wxWindow* nb = GetNotebook();
	AddPage(new ee::LibraryImagePage(nb));
}
Esempio n. 10
0
void CapriceIDEImpl::onSaveAs( wxCommandEvent& event )
{
  GetNotebook()->GetEditor()->SaveFile(true);

}
Esempio n. 11
0
void CapriceIDEImpl::onOpen( wxCommandEvent& event )
{
  GetNotebook()->LoadFile(wxFileName(), _T(""));
}
Esempio n. 12
0
// Menu 
void CapriceIDEImpl::OnNew( wxCommandEvent& event )
{
  GetNotebook()->NewPage();
}
Esempio n. 13
0
   /**
   * Returns a pointer to the active document view, if there is one.
   * @return Pointer to the active HexView instance if any, 0 otherwise.
   */
   HexView *GetActiveView () const {
      wxAuiNotebook *nb = GetNotebook();

      return nb->GetPageCount() ?
         static_cast<HexFrame *>(nb->GetPage(nb->GetSelection()))->GetView() : 0;
   }
Esempio n. 14
0
extern	void
UpdateWidgetData(WidgetData	*data)
{
	GtkWidget	*widget;

	widget = GetWidgetByLongName(data->name);
	g_return_if_fail(widget != NULL);

	switch (data->type) {
// gtk+panda
	case WIDGET_TYPE_NUMBER_ENTRY:
		GetNumberEntry(widget, (_NumberEntry*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_CLIST:
		GetPandaCList(widget, (_CList*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_ENTRY:
	case WIDGET_TYPE_ENTRY:
		GetEntry(widget, (_Entry*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TEXT:
		GetText(widget, (_Text*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TIMER:
		GetPandaTimer(widget, (_Timer*)data->attrs);
		break;
	case WIDGET_TYPE_PANDA_TABLE:
		GetPandaTable(widget, (_Table*)data->attrs);
		break;
	case WIDGET_TYPE_TEXT:
		GetText(widget, (_Text*)data->attrs);
		break;
	case WIDGET_TYPE_TOGGLE_BUTTON:
	case WIDGET_TYPE_CHECK_BUTTON:
	case WIDGET_TYPE_RADIO_BUTTON:
		GetButton(widget, (_Button*)data->attrs);
		break;
	case WIDGET_TYPE_CALENDAR:
		GetCalendar(widget, (_Calendar*)data->attrs);
		break;
	case WIDGET_TYPE_NOTEBOOK:
		GetNotebook(widget, (_Notebook*)data->attrs);
		break;
	case WIDGET_TYPE_PROGRESS_BAR:
		GetProgressBar(widget, (_ProgressBar*)data->attrs);
		break;
	case WIDGET_TYPE_SCROLLED_WINDOW:
		GetScrolledWindow(widget, (_ScrolledWindow*)data->attrs);
		break;
	case WIDGET_TYPE_FILE_CHOOSER_BUTTON:
		GetFileChooserButton(widget, (_FileChooserButton*)data->attrs);
		break;
	case WIDGET_TYPE_COLOR_BUTTON:
		GetColorButton(widget, (_ColorButton*)data->attrs);
		break;
// gtk+
	case WIDGET_TYPE_FILE_ENTRY:
		GetFileEntry(widget, (_FileEntry*)data->attrs);
		break;
	default:
		MessageLogPrintf("invalid widget [%s]", data->name);
		break;
	}
}