// On tab selection, we save the data for the tab which is losing selection and // load the data of the selected tab into the WindowInfo. LRESULT TabsOnNotify(WindowInfo *win, LPARAM lparam, int tab1, int tab2) { LPNMHDR data = (LPNMHDR)lparam; int current; switch(data->code) { case TCN_SELCHANGING: // TODO: Should we allow the switch of the tab if we are in process of printing? SaveCurrentTabInfo(win); return FALSE; case TCN_SELCHANGE: current = TabCtrl_GetCurSel(win->hwndTabBar); LoadModelIntoTab(win, win->tabs.At(current)); break; case T_CLOSING: // allow the closure return FALSE; case T_CLOSE: current = TabCtrl_GetCurSel(win->hwndTabBar); if (tab1 == current) CloseTab(win); else RemoveTab(win, tab1); break; case T_DRAG: SwapTabs(win, tab1, tab2); break; } return TRUE; }
// CMFCTabCtrlEx 메시지 처리기입니다. LRESULT CMFCTabCtrlEx::OnCloseEpub(WPARAM wParam, LPARAM lParam) { TRACE(_T("CMFCTabCtrlEx::OnCloseEpub() START\r\n")); // HRESULT hr = S_OK; // Remove epub theApp.m_WebkitEngine.Close((CWnd *)wParam); // Remove tab int tabID = (int)lParam; int index = GetTabByID(tabID); if(index >= 0) { int next = -1; if(index + 1 < GetTabsNum()) next = index + 1; else if( index - 1 >= 0 ) next = index - 1; // if( next >= 0) { SetActiveTab(next); ShowTab(next); } if(!RemoveTab(index)) return S_FALSE; } // TRACE(_T("CMFCTabCtrlEx::OnCloseEpub() END\r\n")); return hr; }
void CMainTabWnd::RemoveTabById(ETabId eTabId) { if (m_aposTabs[TI_ADVANCE] == m_aposTabs[eTabId]) CPreferences::m_bAdvancePageShowed = false; RemoveTab(m_aposTabs[eTabId]); m_aposTabs[eTabId] = NULL; }
void GxTabContainer::RemoveTab(GxTab* tab) { for(int i=0; i<myTabs.Size(); ++i) { if(myTabs[i] == tab) { RemoveTab(i); return; } } }
/** * Removes a custom pane. * * @param iCustomPane: index of custom pane to remove * (0..number of custom panes - 1) * @return - * @exception - * @see */ void CWatchWindow::RemoveCustomPane (int iCustomPane) { int i; // Must be given the index of a custom pane tab. // Otherwise our caller did something wrong. //////////////////////////////////////////////// ASSERT (iCustomPane >= 0 && iCustomPane < m_iCustomPaneCount); if (iCustomPane < 0 || iCustomPane >= m_iCustomPaneCount) return; // Remove tab of custom pane. ///////////////////////////// RemoveTab (iCustomPane); // Obviously have to decrease number of custom panes. ///////////////////////////////////////////////////// --m_iCustomPaneCount; // Rename all tabs to the right (index has changed -> index depending name changes). //////////////////////////////////////////////////////////////////////////////////// // SIS: only automatic tabs are renamed ETabType eTabType; for (i = iCustomPane; i < m_iCustomPaneCount; ++i) { eTabType = GetTabType(i); if(eTabType == eAutomatic) { m_pTabWindow->RenameTab(i, BuildCustomPaneCaption (i)); } } // If we have a forced pane and we removed before the forced // pane we have to decrease the forced panes tab index. //////////////////////////////////////////////////////////// if (m_iForcedPaneTab != -1 && m_iForcedPaneTab >= 0) --m_iForcedPaneTab; }
void ArpConfigurePanel::ClearPanes(void) { BTab* tab = 0; while( (tab=RemoveTab(0)) != 0 ) { delete tab; } if( mInitSettings ) { for( size_t i=0; i<mInitSettings->size(); i++ ) { delete mInitSettings->at(i); } } FreeMemory(); }
void ControlsView::VolumeTabView::_RemoveVolume(dev_t device) { for (int i = 0; VolumeTab* item = (VolumeTab*)TabAt(i); i++) { if (item->Volume()->Device() == device) { if (i == 0) Select(1); else Select(i - 1); RemoveTab(i); delete item; return; } } }
bool TabCleanup(HWND TabWindow) { assert(IsWindow(TabWindow)); int Count = TabCtrl_GetItemCount(TabWindow); assert(Count >= 0); bool Result = true; for(int i = 1; i <= Count; i++) { Result = RemoveTab(TabWindow, Count-i) && Result; } return Result; }
/** * Remove the "Forced" pane from the watch. * * @param - * @return - * @exception - * @see */ void CWatchWindow::RemoveForcedPane () { // Nothing to do if we don't have the "Forced" pane. //////////////////////////////////////////////////// if (m_iForcedPaneTab == -1) return; // Remove "Forced" pane tab. //////////////////////////// RemoveTab (m_iForcedPaneTab); m_iForcedPaneTab = -1; }
// Called when we're closing a document void TabsOnCloseDoc(WindowInfo* win) { if (win->tabs.size() == 0) return; /* if (win->AsFixed() && win->AsFixed()->userAnnots && win->AsFixed()->userAnnotsModified) { // TODO: warn about unsaved changes } */ int current = TabCtrl_GetCurSel(win->hwndTabBar); RemoveTab(win, current); if (win->tabs.size() > 0) { TabInfo* tab = win->tabSelectionHistory->Pop(); TabCtrl_SetCurSel(win->hwndTabBar, win->tabs.Find(tab)); LoadModelIntoTab(win, tab); } }
//==== Constructor ====// WireScreen::WireScreen( ScreenMgr* mgr ) : GeomScreen( mgr, 300, 525, "Wireframe" ) { RemoveTab( GetTab( m_SubSurfTab_ind ) ); Fl_Group* wire_tab = AddTab( "WireFrame" ); Fl_Group* wire_group = AddSubGroup( wire_tab, 5 ); m_WireLayout.SetGroupAndScreen( wire_group, this ); m_WireLayout.AddDividerBox( "Wireframe Characteristics" ); m_TypeChoice.AddItem( "Lifting" ); m_TypeChoice.AddItem( "Non-Lifting" ); m_WireLayout.AddChoice( m_TypeChoice, "Type" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Normal Vector" ); m_WireLayout.AddButton( m_InvertButton, "Invert" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Swap Point Ordering" ); m_WireLayout.AddButton( m_SwapIJButton, "Swap I/J" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Reverse" ); m_WireLayout.AddButton( m_RevIButton, "Reverse I" ); m_WireLayout.AddButton( m_RevJButton, "Reverse J" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Patch" ); m_IStartPatchTypeChoice.AddItem( "None" ); m_IStartPatchTypeChoice.AddItem( "Point" ); m_IStartPatchTypeChoice.AddItem( "Line" ); m_IStartPatchTypeChoice.AddItem( "Copy Opposite" ); m_IStartPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_IStartPatchTypeChoice, "I Start" ); m_IEndPatchTypeChoice.AddItem( "None" ); m_IEndPatchTypeChoice.AddItem( "Point" ); m_IEndPatchTypeChoice.AddItem( "Line" ); m_IEndPatchTypeChoice.AddItem( "Copy Opposite" ); m_IEndPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_IEndPatchTypeChoice, "I End" ); m_JStartPatchTypeChoice.AddItem( "None" ); m_JStartPatchTypeChoice.AddItem( "Point" ); m_JStartPatchTypeChoice.AddItem( "Line" ); m_JStartPatchTypeChoice.AddItem( "Copy Opposite" ); m_JStartPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_JStartPatchTypeChoice, "J Start" ); m_JEndPatchTypeChoice.AddItem( "None" ); m_JEndPatchTypeChoice.AddItem( "Point" ); m_JEndPatchTypeChoice.AddItem( "Line" ); m_JEndPatchTypeChoice.AddItem( "Copy Opposite" ); m_JEndPatchTypeChoice.AddItem( "Halfway Opposite" ); m_WireLayout.AddChoice( m_JEndPatchTypeChoice, "J End" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Start/End Skip" ); m_WireLayout.AddIndexSelector( m_ISkipStartIndexSelector, "I Start Skip" ); m_WireLayout.AddIndexSelector( m_ISkipEndIndexSelector, "I End Skip" ); m_WireLayout.AddIndexSelector( m_JSkipStartIndexSelector, "J Start Skip" ); m_WireLayout.AddIndexSelector( m_JSkipEndIndexSelector, "J End Skip" ); m_WireLayout.AddYGap(); m_WireLayout.AddDividerBox( "Stride" ); m_WireLayout.AddIndexSelector( m_IStrideIndexSelector, "I Stride" ); m_WireLayout.AddIndexSelector( m_JStrideIndexSelector, "J Stride" ); }
//==== Constructor ====// HingeScreen::HingeScreen( ScreenMgr* mgr ) : GeomScreen( mgr, 300, 720, "Hinge" ) { Fl_Group* orient_tab = AddTab( "Orient" ); Fl_Group* orient_group = AddSubGroup( orient_tab, 5 ); m_BaseOrientationLayout.SetGroupAndScreen( orient_group, this ); m_BaseOrientationLayout.AddDividerBox( "Orient Base" ); m_BaseOrientationLayout.AddButton( m_OrientRotToggle, "Rotations (Use XForm Tab)" ); m_BaseOrientationLayout.AddButton( m_OrientVecToggle, "Vectors" ); m_OrientTypeGroup.Init( this ); m_OrientTypeGroup.AddButton( m_OrientRotToggle.GetFlButton() ); m_OrientTypeGroup.AddButton( m_OrientVecToggle.GetFlButton() ); m_BaseOrientationLayout.AddYGap(); m_BaseOrientationLayout.AddDividerBox( "Vectors" ); // Indivdual SubSurface Parameters m_PrimaryDirLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimaryDirLayout.SetY( m_BaseOrientationLayout.GetY() ); m_PrimaryDirLayout.SetButtonWidth( m_PrimaryDirLayout.GetW()/4 ); m_PrimaryDirLayout.SetSameLineFlag( true ); m_PrimaryDirLayout.SetFitWidthFlag( false ); m_PrimaryDirLayout.AddLabel( "Axis", m_PrimaryDirLayout.GetButtonWidth() ); m_PrimaryDirLayout.AddButton( m_PrimaryXToggle, "X" ); m_PrimaryDirLayout.AddButton( m_PrimaryYToggle, "Y" ); m_PrimaryDirLayout.AddButton( m_PrimaryZToggle, "Z" ); m_PrimaryDirLayout.ForceNewLine(); m_PrimaryDirGroup.Init( this ); m_PrimaryDirGroup.AddButton( m_PrimaryXToggle.GetFlButton() ); m_PrimaryDirGroup.AddButton( m_PrimaryYToggle.GetFlButton() ); m_PrimaryDirGroup.AddButton( m_PrimaryZToggle.GetFlButton() ); m_SecondaryDirLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_SecondaryDirLayout.SetY( m_PrimaryDirLayout.GetY() ); m_SecondaryDirLayout.SetButtonWidth( m_SecondaryDirLayout.GetW()/4 ); m_SecondaryDirLayout.SetSameLineFlag( true ); m_SecondaryDirLayout.SetFitWidthFlag( false ); m_SecondaryDirLayout.AddLabel( "Reference", m_SecondaryDirLayout.GetButtonWidth() ); m_SecondaryDirLayout.AddButton( m_SecondaryXToggle, "X" ); m_SecondaryDirLayout.AddButton( m_SecondaryYToggle, "Y" ); m_SecondaryDirLayout.AddButton( m_SecondaryZToggle, "Z" ); m_SecondaryDirLayout.ForceNewLine(); m_SecondaryDirGroup.Init( this ); m_SecondaryDirGroup.AddButton( m_SecondaryXToggle.GetFlButton() ); m_SecondaryDirGroup.AddButton( m_SecondaryYToggle.GetFlButton() ); m_SecondaryDirGroup.AddButton( m_SecondaryZToggle.GetFlButton() ); m_VectorLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_VectorLayout.SetY( m_SecondaryDirLayout.GetY() ); m_VectorLayout.AddYGap(); m_VectorLayout.AddDividerBox( "Axis" ); m_PrimTypeChoice.AddItem( "VECTOR3D" ); m_PrimTypeChoice.AddItem( "POINT3D" ); m_PrimTypeChoice.AddItem( "SURFPT" ); m_PrimTypeChoice.AddItem( "UDIR" ); m_PrimTypeChoice.AddItem( "WDIR" ); m_PrimTypeChoice.AddItem( "NDIR" ); m_VectorLayout.AddChoice( m_PrimTypeChoice, "Type" ); m_VectorLayout.AddYGap(); m_PrimVecLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimVecLayout.SetY( m_VectorLayout.GetY() ); m_PrimVecLayout.SetFitWidthFlag( false ); m_PrimVecLayout.SetSameLineFlag( true ); m_PrimVecLayout.AddLabel( "Direction Vector:", 170 ); m_PrimVecLayout.SetButtonWidth( m_PrimVecLayout.GetRemainX() / 2 ); m_PrimVecLayout.AddButton( m_PrimVecRelToggle, "Rel" ); m_PrimVecLayout.AddButton( m_PrimVecAbsToggle, "Abs" ); m_PrimVecLayout.ForceNewLine(); m_PrimVecAbsRelToggle.Init( this ); m_PrimVecAbsRelToggle.AddButton( m_PrimVecAbsToggle.GetFlButton() ); m_PrimVecAbsRelToggle.AddButton( m_PrimVecRelToggle.GetFlButton() ); m_PrimVecLayout.SetFitWidthFlag( true ); m_PrimVecLayout.SetSameLineFlag( false ); m_PrimVecLayout.AddYGap(); m_PrimVecLayout.SetButtonWidth( 50 ); m_PrimVecLayout.AddSlider( m_PrimXVecSlider, "X", 10.0, "%7.3f" ); m_PrimVecLayout.AddSlider( m_PrimYVecSlider, "Y", 10.0, "%7.3f" ); m_PrimVecLayout.AddSlider( m_PrimZVecSlider, "Z", 10.0, "%7.3f" ); m_VectorLayout.SetY( m_PrimVecLayout.GetY() ); m_VectorLayout.AddYGap(); m_PrimOffLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimOffLayout.SetY( m_VectorLayout.GetY() ); m_PrimOffLayout.SetFitWidthFlag( false ); m_PrimOffLayout.SetSameLineFlag( true ); m_PrimOffLayout.AddLabel( "Offset:", 170 ); m_PrimOffLayout.SetButtonWidth( m_PrimOffLayout.GetRemainX() / 2 ); m_PrimOffLayout.AddButton( m_PrimOffRelToggle, "Rel" ); m_PrimOffLayout.AddButton( m_PrimOffAbsToggle, "Abs" ); m_PrimOffLayout.ForceNewLine(); m_PrimOffAbsRelToggle.Init( this ); m_PrimOffAbsRelToggle.AddButton( m_PrimOffAbsToggle.GetFlButton() ); m_PrimOffAbsRelToggle.AddButton( m_PrimOffRelToggle.GetFlButton() ); m_PrimOffLayout.SetFitWidthFlag( true ); m_PrimOffLayout.SetSameLineFlag( false ); m_PrimOffLayout.AddYGap(); m_PrimOffLayout.SetButtonWidth( 50 ); m_PrimOffLayout.AddSlider( m_PrimXOffSlider, "X", 10.0, "%7.3f" ); m_PrimOffLayout.AddSlider( m_PrimYOffSlider, "Y", 10.0, "%7.3f" ); m_PrimOffLayout.AddSlider( m_PrimZOffSlider, "Z", 10.0, "%7.3f" ); m_VectorLayout.SetY( m_PrimOffLayout.GetY() ); m_VectorLayout.AddYGap(); m_PrimUWLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_PrimUWLayout.SetY( m_VectorLayout.GetY() ); m_PrimUWLayout.AddSlider( m_PrimUSlider, "U", 1, "%5.4f" ); m_PrimUWLayout.AddSlider( m_PrimWSlider, "W", 1, "%5.4f" ); m_VectorLayout.SetY( m_PrimUWLayout.GetY() ); m_VectorLayout.AddYGap(); m_SecVecLayout.SetGroupAndScreen( AddSubGroup( orient_tab, 5 ), this ); m_SecVecLayout.SetY( m_VectorLayout.GetY() ); m_SecVecLayout.AddDividerBox( "Reference Vector" ); m_SecVecLayout.SetFitWidthFlag( false ); m_SecVecLayout.SetSameLineFlag( true ); m_SecVecLayout.SetButtonWidth( m_SecVecLayout.GetRemainX() / 3 ); m_SecVecLayout.AddLabel( "Reference Vec", m_SecVecLayout.GetButtonWidth() ); m_SecVecLayout.AddButton( m_SecVecAbsToggle, "Rel" ); m_SecVecLayout.AddButton( m_SecVecRelToggle, "Abs" ); m_SecVecLayout.ForceNewLine(); m_SecVecAbsRelToggle.Init( this ); m_SecVecAbsRelToggle.AddButton( m_SecVecAbsToggle.GetFlButton() ); m_SecVecAbsRelToggle.AddButton( m_SecVecRelToggle.GetFlButton() ); m_SecVecLayout.AddButton( m_SecondaryVecXToggle, "X" ); m_SecVecLayout.AddButton( m_SecondaryVecYToggle, "Y" ); m_SecVecLayout.AddButton( m_SecondaryVecZToggle, "Z" ); m_SecVecLayout.ForceNewLine(); m_SecondaryVecDirGroup.Init( this ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecXToggle.GetFlButton() ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecYToggle.GetFlButton() ); m_SecondaryVecDirGroup.AddButton( m_SecondaryVecZToggle.GetFlButton() ); Fl_Group* motion_tab = AddTab( "Motion" ); Fl_Group* motion_group = AddSubGroup( motion_tab, 5 ); m_MotionLayout.SetGroupAndScreen( motion_group, this ); int bw = 110; int tw = 15; int sw = 35; m_MotionLayout.SetSameLineFlag( false ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.AddDividerBox( "DOF and Coordinates" ); m_MotionLayout.AddYGap(); m_MotionLayout.AddDividerBox( "Translate" ); m_MotionLayout.SetSameLineFlag( true ); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTransMinToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTransMinSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTransMinSlider, "Min", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTranslateToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTranslateRngButton, "Rng" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTranslateSlider, "Translate", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointTransMaxToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointTransMaxSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointTransMaxSlider, "Max", 10, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.AddYGap(); m_MotionLayout.SetSameLineFlag( false ); m_MotionLayout.AddDividerBox( "Rotate" ); m_MotionLayout.SetSameLineFlag( true ); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotMinToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotMinSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotMinSlider, "Min", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotateToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotateRngButton, "Rng" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotateSlider, "Rotate", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); m_MotionLayout.SetFitWidthFlag( false ); m_MotionLayout.SetButtonWidth( tw ); m_MotionLayout.AddButton( m_JointRotMaxToggle, "" ); m_MotionLayout.SetButtonWidth( sw ); m_MotionLayout.AddButton( m_JointRotMaxSetButton, "Set" ); m_MotionLayout.SetFitWidthFlag( true ); m_MotionLayout.SetButtonWidth( bw - tw - sw ); m_MotionLayout.AddSlider( m_JointRotMaxSlider, "Max", 100, "%6.2f" ); m_MotionLayout.ForceNewLine(); RemoveTab( GetTab( m_SubSurfTab_ind ) ); }