コード例 #1
0
ファイル: editor.cpp プロジェクト: 8l/objeck-lang
void Notebook::OpenFile(const wxString& fn)
{
  wxFileName w(fn);
  w.Normalize();
  wxString filename = w.GetFullPath();

  // set page focus
  Pages::iterator found = pages.find(filename);
  if(found != pages.end()) {
    int page_index = GetPageIndex(found->second);
    if(page_index != wxNOT_FOUND) {
      SetSelection(page_index);
    }
  }
  // add new page and set focus
  else {
    Edit* edit = new Edit(this);
    edit->LoadFile(filename);
    edit->SelectNone();

    Freeze();
    AddPage(edit, w.GetFullName());
    Thaw();

    pages[filename] = edit;

    int page_index = GetPageIndex(edit);
    if(page_index != wxNOT_FOUND) {
      SetSelection(page_index);
    }
  }
}
コード例 #2
0
moExplorerNotebook::moExplorerNotebook( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) :
		wxAuiNotebook(parent, id, wxPoint(0,0), wxSize(100,100),  wxBORDER_NONE | wxSP_NOBORDER | wxNO_BORDER |  wxAUI_NB_SCROLL_BUTTONS ),
		m_pVisualsPaletteCtrl(NULL),
		m_pProjectTreeCtrl(NULL),
		m_pEffectsPaletteCtrl(NULL),
		m_pFilesTreeCtrl(NULL)
		 {

    SetArtProvider( new wxMoAuiTabArt() );

    wxColour m_cForeground(255,255,255);
    wxColour m_cBackground(0,0,0);

    ///arbol de la configuracion del proyecto
		m_pProjectTreeCtrl = new moProjectTreeCtrl( this, wxID_ANY, wxPoint(0,0), wxSize(300,377), wxTR_DEFAULT_STYLE | wxNO_BORDER | wxBORDER_NONE);
		if (m_pProjectTreeCtrl) {
      m_pProjectTreeCtrl->SetNextActionHandler( this );
      m_pProjectTreeCtrl->SetForegroundColour(m_cForeground);
      m_pProjectTreeCtrl->SetBackgroundColour(m_cBackground);
      if ( AddPage( m_pProjectTreeCtrl, wxT("Project") ) ) {
        SetPageBitmap( GetPageIndex( m_pProjectTreeCtrl ), wxBitmap(wxImage(_T("../../art/icons/ontology_16.png"))) );
      }
		}

		/// paleta de efectos para agregar
		//m_pEffectsPaletteCtrl = new moEffectsPaletteCtrl( this, wxID_ANY );
		if (m_pEffectsPaletteCtrl) {
      m_pEffectsPaletteCtrl->SetNextActionHandler( this );
      m_pEffectsPaletteCtrl->SetForegroundColour(m_cForeground);
      m_pEffectsPaletteCtrl->SetBackgroundColour(m_cBackground);

      if (AddPage( m_pEffectsPaletteCtrl, wxT("FX Palette") ) ) {
        SetPageBitmap( GetPageIndex( m_pEffectsPaletteCtrl ), wxBitmap(wxImage(_T("../../art/icons/rdf_16.png"))) );
      }
		}

		///visuales ( texturas, videos, animados, bufferes circulares, etc... )
		//m_pVisualsPaletteCtrl = new moVisualsPaletteCtrl(this, wxID_ANY );
		if (m_pVisualsPaletteCtrl) {
      m_pVisualsPaletteCtrl->SetNextActionHandler( this );
      m_pVisualsPaletteCtrl->SetForegroundColour(m_cForeground);
      m_pVisualsPaletteCtrl->SetBackgroundColour(m_cBackground);

      if (AddPage( m_pVisualsPaletteCtrl, wxT("Visuals") ) ) {
        SetPageBitmap( GetPageIndex( m_pVisualsPaletteCtrl ), wxBitmap(wxImage(_T("../../art/icons/image_16.png"))) );
      }

		}

		///arbol de archivos en el directorio de datos
		m_pFilesTreeCtrl = new wxVirtualDirTreeCtrl( this, wxID_ANY, wxPoint(0,0), wxSize(300,377),wxTR_DEFAULT_STYLE | wxNO_BORDER | wxBORDER_NONE );
		if (m_pFilesTreeCtrl) {
		  m_pFilesTreeCtrl->SetForegroundColour(m_cForeground);
		  m_pFilesTreeCtrl->SetBackgroundColour(m_cBackground);
		  if (AddPage( m_pFilesTreeCtrl, wxT("Files") ) ) {
        SetPageBitmap( GetPageIndex( m_pFilesTreeCtrl ), wxBitmap(wxImage(_T("../../art/icons/folder_sans_16.png"))) );
		  }
		}

}
コード例 #3
0
ファイル: Notebook.cpp プロジェクト: wojciech-holisz/3d-city
void Notebook::setActivePage(PageType page)
{
	switch (page)
	{
		case PAGE_INFO: SetSelection(GetPageIndex(mInfo)); break;
		case PAGE_EXPLORER: SetSelection(GetPageIndex(mExplorer)); break;
		case PAGE_LIBRARY: SetSelection(GetPageIndex(mLibrary)); break;
		case PAGE_PROPERTIES: SetSelection(GetPageIndex(mProperties)); break;
		case PAGE_TOOLS: SetSelection(GetPageIndex(mTools)); break;
	}
}
コード例 #4
0
ファイル: moLogNotebook.cpp プロジェクト: inaes-tic/tv-moldeo
void moLogNotebook::LogError( moText p_message ) {


    if (m_pLogBase) {
      m_pLogBase->LogError( p_message );
    }

    if (m_pLogError) {
      m_pLogError->LogError( p_message );
    }

    if (GetSelection()!=GetPageIndex(m_pLogError))
        SetSelection(GetPageIndex(m_pLogError));

}
コード例 #5
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
bool InfoPane::DeleteLogger(Logger* l)
{
    if (!l)
    {
        return false;
    }

    for(int i = 0; i < num_pages; ++i)
    {
        if(page[i].logger == l)
        {
            int index = Manager::Get()->GetLogManager()->FindIndex(l);
            if (index != -1)
            {
                Manager::Get()->GetLogManager()->DeleteLog(index);
            }

            if (page[i].indexInNB != -1)
            {
                DeletePage(GetPageIndex(page[i].window));
            }

            page[i] = Page();
            return true;
        }
    }

   return false;
}
コード例 #6
0
/*--------------------------------------------------------------------
FUNCTION:	OnSelChanged(NMHDR* pNotifyStruct, LRESULT* pResult);
RETURNS:		
PURPOSE:		
--------------------------------------------------------------------*/
void	 CTreePropertySheet::OnSelChanged(
				NMHDR* pNotifyStruct, 
				LRESULT* pResult)
{
	NMTREEVIEW	*pNotify=(NMTREEVIEW*)pNotifyStruct;

	(*pResult)	=0;
	
	int		dwPage=m_cTreeCtrl.GetItemData(pNotify->itemNew.hItem);
	LockWindowUpdate();
  if (GetPageIndex(GetActivePage()) != dwPage)    // NJG
  {
	  /* Theming has these nice fades inbetween controls being disabled and enabled.
	   * That is all nice and well, but switching a page for the _first_ time since
	   * the dialog had been opened causes the dialog controls to be updated in plain
	   * sight - a rather visible and eye-catching affair once you are aware of it.
	   * Updating the dialog controls manually before switching to the active page
	   * causes these updates to be done while the user cannot see it. -JW
	   */
	  GetPage(dwPage)->UpdateDialogControls(this, false);
	  SetActivePage(dwPage);
  }
	UnlockWindowUpdate();

	// Prevent losing the focus when invoked by keyboard
	if(pNotify->action==TVC_BYKEYBOARD)
		m_cTreeCtrl.SetFocus();

  InvalidateRect(NULL, FALSE);  /* invalidate entire control for redraw -JW */
}
コード例 #7
0
ファイル: slbook.cpp プロジェクト: renemilk/springlobby
// Advances the selection, generation page selection events
void SLNotebook::AdvanceSelection(bool forward)
{
	if (GetPageCount() <= 1)
		return;
	int currentSelection = GetSelection();
	wxAuiTabCtrl* tabCtrl = 0;
	int idx = -1;

	if(!FindTab(GetPage(currentSelection), &tabCtrl, &idx))
		return;

	if(!tabCtrl || idx < 0)
		return;

	wxWindow* page = 0;
	size_t maxPages = tabCtrl->GetPageCount();

	forward?idx++:idx--;

	if(idx < 0)
		idx = maxPages - 1;

	if ((size_t)idx < maxPages)
		page = tabCtrl->GetPage(idx).window;

	if (!page && maxPages > 0)
		page = tabCtrl->GetPage(0).window;

	if(page)
	{
		currentSelection = GetPageIndex(page);
		SetSelection(currentSelection);
	}
}
コード例 #8
0
BOOL
CConvertWizardSheet::PreTranslateMessage(MSG* pMsg)
{
    PGPBoolean	weProcessed	= FALSE;
    PGPUInt8	vCode;
    PGPUInt32	activeIndex, randomIndex;

    switch (pMsg->message)
    {
    case WM_KEYDOWN:
        vCode = pMsg->wParam & 0x7F;

        activeIndex	= GetActiveIndex();
        randomIndex	= GetPageIndex(&mRandomDataPage);

        if ((activeIndex == randomIndex) &&
                !mRandomDataPage.mIsDoneCollecting)
        {
            // Punt key messages down for random data collection.
            mRandomDataPage.PostMessage(pMsg->message, pMsg->wParam,
                                        pMsg->lParam);

            weProcessed = TRUE;
        }
        break;
    }

    return (weProcessed ? TRUE : CPropertySheet::PreTranslateMessage(pMsg));
}
コード例 #9
0
ファイル: OptionSheet.cpp プロジェクト: leiqunni/STEP_Unicode
int COptionSheet::GetActiveIndex() const
{
	if(NULL == m_CurrentPage) {
		return -1;
	}

	return GetPageIndex(m_CurrentPage);
}
コード例 #10
0
ファイル: Notebook.cpp プロジェクト: SgtFlame/indiezen
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
Notebook::hidePage(wxWindow* _pWindow)
{
    int pageIndex = GetPageIndex(_pWindow);
    if (pageIndex != wxNOT_FOUND)
    {
        RemovePage(pageIndex);
    }
}
コード例 #11
0
BOOL CRtsSettingsWizDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
	if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL))
	{
		// Store the last open page to a variable, for later storage
		g_iCurPropertyPage = GetPageIndex(GetActivePage());
	}

	return CPropertySheet::OnCommand(wParam, lParam);
}
コード例 #12
0
//***************************************************************************************
void CBCGPropertySheet::OnActivatePage (CPropertyPage* pPage)
{
	ASSERT_VALID (this);
	ASSERT_VALID (pPage);

	if (m_wndOutlookBar.GetSafeHwnd () != NULL)
	{
		if (m_nActivePage >= 0)
		{
			m_wndOutlookBar.SetButtonStyle (m_nActivePage, 0);
		}

		int nPage = GetPageIndex (pPage);
		ASSERT (nPage >= 0);

		m_nActivePage = nPage;

		PostMessage (UM_AFTERACTIVATEPAGE);
	}

	if (m_wndTree.GetSafeHwnd () != NULL)
	{
		CBCGPropertyPage* pBCGPropPage = DYNAMIC_DOWNCAST (CBCGPropertyPage, pPage);
		if (pBCGPropPage != NULL)
		{
			if (!m_bIsInSelectTree)
			{
				m_wndTree.SelectItem (pBCGPropPage->m_hTreeNode);
			}

			m_wndTree.EnsureVisible (pBCGPropPage->m_hTreeNode);
		}
	}

	if (m_wndTab.GetSafeHwnd () != NULL)
	{
		const int nTab = GetPageIndex (pPage);

		m_wndTab.SetActiveTab (nTab);
		m_wndTab.EnsureVisible (nTab);
	}
}
コード例 #13
0
BOOL CMyPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
{
   if (LOWORD(wParam) == IDOK)
   {
      CMDIFrameWnd* pframe = (CMDIFrameWnd*) AfxGetMainWnd();
      CMDIChildWnd* pchild = pframe->MDIGetActive();
      CPSheetDoc* doc = (CPSheetDoc*) pchild->GetActiveDocument();
      doc->m_LastActivePage = GetPageIndex(GetActivePage()); // or GetActiveIndex()
   }

   return CPropertySheet::OnCommand(wParam, lParam);
}
コード例 #14
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
void InfoPane::Show(size_t i)
{
    if(page[i].window == 0)
        return;

    if(page[i].indexInNB == -1)
    {
        Toggle(i);
    }
    else
    {
        SetSelection(GetPageIndex(page[i].window));
    }
}
コード例 #15
0
ファイル: Notebook.cpp プロジェクト: SgtFlame/indiezen
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
Notebook::showPage(wxWindow* _pWindow)
{
    int pageIndex = GetPageIndex(_pWindow);
    if (pageIndex != wxNOT_FOUND)
    {
        SetSelection(pageIndex);
    }
    else
    {
        const size_t pageCount = GetPageCount();
        AddPage(_pWindow, _pWindow->GetLabel());
        SetSelection(pageCount);
    }
}
コード例 #16
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
void InfoPane::Toggle(size_t i)
{
    if(page[i].indexInNB == -1)
        page[i].indexInNB = AddPagePrivate(page[i].window, page[i].title, page[i].icon);
    else
    {
        // Hide the window, otherwise the controls remain partly visible on some windows-versions
        // if we toggle the active logger
        if(page[i].window)
        {
            page[i].window->Hide();
        }
        RemovePage(GetPageIndex(page[i].window));
        page[i].indexInNB = -1;
    }
}
コード例 #17
0
bool Notebook::DoNavigate()
{
    if ( !m_popupWin && GetPageCount() > 1) {

        m_popupWin = new NotebookNavDialog( this );
        m_popupWin->ShowModal();

        wxWindow *page = m_popupWin->GetSelection();
        m_popupWin->Destroy();
        m_popupWin = NULL;

        SetSelection( GetPageIndex(page), true );
        return true;
    }
    return false;
}
コード例 #18
0
//****************************************************************************************
void CBCGPropertySheet::RemovePage(CPropertyPage* pPage)
{
	int nPage = GetPageIndex (pPage);
	ASSERT (nPage >= 0);

	CPropertySheet::RemovePage (pPage);

	if (m_wndOutlookBar.GetSafeHwnd () != NULL)
	{
		m_wndOutlookBar.RemoveButton (nPage);
	}

	if (m_wndTree.GetSafeHwnd () != NULL)
	{
		ASSERT (FALSE);
	}
}
コード例 #19
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
void InfoPane::ShowNonLogger(wxWindow* p)
{
    for(int i = 0; i < num_pages; ++i)
    {
        if(page[i].window == p)
        {
            if(page[i].indexInNB == -1)
            {
                Toggle(i);
            }
            else
            {
                SetSelection(GetPageIndex(p));
            }
            return;
        }
    }
}
コード例 #20
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
void InfoPane::Show(Logger* logger)
{
    for(int i = 0; i < num_pages; ++i)
    {
        if(page[i].logger == logger)
        {
            if(page[i].indexInNB == -1)
            {
                Toggle(i);
            }
            else
            {
                SetSelection(GetPageIndex(page[i].window));
            }
            return;
        }
    }
}
コード例 #21
0
ファイル: Notebook.cpp プロジェクト: SgtFlame/indiezen
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
Notebook::showPage(I_View& _view)
{
    // TODO This should call getWindow() from I_View instead of assuming
    //      _view is a View.
    View* const pView = dynamic_cast<View*>(&_view);

    const int pageIndex = GetPageIndex(pView);
    if (pageIndex != wxNOT_FOUND)
    {
        SetSelection(pageIndex);
    }
    else
    {
        const size_t pageCount = GetPageCount();
        AddPage(pView, pView->GetLabel());
        SetSelection(pageCount);
    }
}
コード例 #22
0
ファイル: infopane.cpp プロジェクト: 469306621/Languages
bool InfoPane::RemoveNonLogger(wxWindow* p)
{
    for(int i = 0; i < num_pages; ++i)
    {
        if(page[i].window == p)
        {
            if(page[i].islogger)
            {
                cbThrow(_T("Bad API usage. Shame on you."));
            }

            RemovePage(GetPageIndex(page[i].window));
            page[i] = Page();
            return true;
        }
    }

   return false;
}
コード例 #23
0
ファイル: frmpreferences.cpp プロジェクト: uesoft/AutoPHS
void CFrmPreferences::OnRestoreDefault()
{
	CPropertyPage* pActivePage = GetActivePage();
	int indexPage = GetPageIndex(pActivePage);
	
	switch(indexPage)
	{
	case 0:
		((CPreCalPag*)pActivePage)->DoDefaultSetting();
		break;
	case 1:
		((CPreDrawPag*)pActivePage)->DoDefaultSetting();
		break;
	case 2:
		((CPrePointPag*)pActivePage)->DoDefaultSetting();
		break;
    case 3:
		((CPreStylePag*)pActivePage)->DoDefaultSetting();
		break;
	default:
		break;
	};
}
コード例 #24
0
ファイル: STabCtrl.cpp プロジェクト: kenchen1101/soui
SWindow * STabCtrl::GetPage( LPCTSTR pszName,BOOL bTitle/*=TRUE*/ )
{
    int iPage = GetPageIndex(pszName,bTitle);
    if(iPage == -1) return NULL;
    return m_lstPages[iPage];
}
コード例 #25
0
BOOL CPropertyPageHost::EnsurePageCreated(const CPropertyPage* pPage)
{
	return EnsurePageCreated(GetPageIndex(pPage));
}
コード例 #26
0
ファイル: lenmus_canvas.cpp プロジェクト: gouchi/lenmus
//---------------------------------------------------------------------------------------
int ContentWindow::get_canvas_index(Canvas* pCanvas)
{
    return GetPageIndex(pCanvas);
}
コード例 #27
0
ファイル: STabCtrl.cpp プロジェクト: kenchen1101/soui
BOOL STabCtrl::SetCurSel( LPCTSTR pszName,BOOL bTitle/*=TRUE */)
{
    int iPage = GetPageIndex(pszName,bTitle);
    if(iPage == -1) return FALSE;
    return SetCurSel(iPage);
}