void LDesktop::UpdatePanels(){ if(DEBUG){ qDebug() << " - Update Panels For Screen:" << desktopnumber; } int panels = settings->value(DPREFIX+"panels", -1).toInt(); //if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop //Remove all extra panels for(int i=0; i<PANELS.length(); i++){ if(panels <= PANELS[i]->number()){ if(DEBUG){ qDebug() << " -- Remove Panel:" << PANELS[i]->number(); } PANELS[i]->prepareToClose(); delete PANELS.takeAt(i); i--; } } for(int i=0; i<panels; i++){ //Check for a panel with this number bool found = false; for(int p=0; p<PANELS.length() && !found; p++){ if(PANELS[p]->number() == i){ found = true; if(DEBUG){ qDebug() << " -- Update panel "<< i; } //panel already exists - just update it QTimer::singleShot(0, PANELS[p], SLOT(UpdatePanel()) ); } } if(!found){ if(DEBUG){ qDebug() << " -- Create panel "<< i; } //New panel LPanel *pan = new LPanel(settings, desktopnumber, i, bgWindow); PANELS << pan; pan->show(); } } //Give it a 1/2 second before ensuring that the visible desktop area is correct QTimer::singleShot(500, this, SLOT(UpdateDesktopPluginArea()) ); }
void LDesktop::UpdatePanels(){ qDebug() << " - Update Panels:" << desktopnumber; int panels = settings->value(DPREFIX+"panels", -1).toInt(); if(panels==-1 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop //Remove all extra panels for(int i=0; i<PANELS.length(); i++){ if(panels <= PANELS[i]->number()){ delete PANELS.takeAt(i); i--; } } for(int i=0; i<panels; i++){ //Check for a panel with this number bool found = false; for(int p=0; p<PANELS.length(); p++){ if(PANELS[p]->number() == i){ found = true; qDebug() << " -- Update panel "<< i; //panel already exists - just update it QTimer::singleShot(1, PANELS[i], SLOT(UpdatePanel()) ); } } if(!found){ qDebug() << " -- Create panel "<< i; //New panel PANELS << new LPanel(settings, desktopnumber, i); } } }
LPanel::LPanel(QSettings *file, int scr, int num) : QWidget(){ //Take care of inputs qDebug() << " - Creating Panel:" << scr << num; settings = file; screennum = scr; screen = new QDesktopWidget(); PPREFIX = "panel"+QString::number(screennum)+"."+QString::number(num)+"/"; if(settings->value("defaultpanel",QString::number(screen->primaryScreen())+".0").toString()==QString::number(screennum)+"."+QString::number(num) ){ defaultpanel=true;} else{defaultpanel=false; } //Setup the panel qDebug() << " -- Setup Panel"; this->setContentsMargins(0,0,0,0); this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); this->setWindowFlags( Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint ); this->setFocusPolicy(Qt::NoFocus); this->setWindowTitle(""); this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); this->setAttribute(Qt::WA_AlwaysShowToolTips); this->setObjectName("LuminaPanelWidget"); //LX11::SetAsPanel(this->winId()); //set proper type of window for a panel since Qt can't do it LX11::SetAsSticky(this->winId()); layout = new QHBoxLayout(this); layout->setContentsMargins(0,0,0,0); layout->setAlignment(Qt::AlignLeft); this->setLayout(layout); QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes }
void OccurrencesHighlighting::OnHighlightRemove(wxCommandEvent& WXUNUSED(event)) { wxString word = GetWordAtCaret(); m_texts.erase(word); m_pHighlighter->TextsChanged(); UpdatePanel(); }
void CSimpleTaskPanel::OnTaskSelection(wxCommandEvent& /*event*/) { int sel = m_TaskSelectionCtrl->GetSelection(); if (sel != m_CurrentTaskSelection) { m_CurrentTaskSelection = sel; m_bStableTaskInfoChanged = true; UpdatePanel(); } }
BOOL StopService(CServiceManager* sm) { PanelInfo pi; ZeroMemory(&pi, sizeof(PanelInfo)); pi.StructSize = sizeof(PanelInfo); if (Info.PanelControl(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, &pi)) { size_t CurItem = pi.CurrentItem; if (CurItem > 0) { size_t Size = Info.PanelControl(PANEL_ACTIVE,FCTL_GETPANELITEM, CurItem, 0); PluginPanelItem *PPI=(PluginPanelItem*)malloc(Size); if (PPI) { FarGetPluginPanelItem FGPPI = {Size, PPI}; Info.PanelControl(PANEL_ACTIVE, FCTL_GETPANELITEM, CurItem, &FGPPI); size_t Index = FGPPI.Item->UserData; free(PPI); if (Index < sm->GetCount()) { bool bStop = sm->StopService(Index); if (bStop) { ShowMessage(NULL, L"Stopping service...", FMSG_NONE); int nWait = 300; while (true) { SERVICE_STATUS_PROCESS QueryServiceStatus; if (sm->QueryServiceStatus(Index, QueryServiceStatus) && QueryServiceStatus.dwCurrentState == SERVICE_STOPPED) { break; } Sleep(100); nWait -= 1; if (!nWait) break; } UpdatePanel(true); RedrawPanel(true); RedrawPanel(false); } else ShowLastError(&MsgCantStopServiceGuid); } } } } return TRUE; }
void GetHeight(int& h, TForm* f) { if (f){ TPanel* pa; for (int j=0; j<f->ControlCount; j++){ TComponent* temp = f->Controls[j]; GetHeight(h,dynamic_cast<TForm*>(temp)); pa = dynamic_cast<TPanel*>(temp); if (pa&&pa->Visible){ h+=pa->Height; UpdatePanel(pa);} } } }
void LPanel::scalePanel(double xscale, double yscale){ int ht = settings->value(PPREFIX+"height", 30).toInt(); //this is technically the distance into the screen from the edge QString loc = settings->value(PPREFIX+"location","").toString().toLower(); if(loc=="top" || loc=="bottom"){ ht = qRound(ht*yscale); }else{ ht = qRound(ht*xscale); } settings->setValue(PPREFIX+"height", ht); settings->sync(); QTimer::singleShot(0, this, SLOT(UpdatePanel()) ); }
cEnforcementFullPanel::cEnforcementFullPanel(wxFrame*frame) : wxPanel(frame) { cEnforcementFullPanel* itemPanel1 = this; this->SetBackgroundColour(wxColour(0, 0, 0)); wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemPanel1->SetSizer(itemBoxSizer2); wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW | wxALL, 0); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer4, 1, wxGROW | wxALL, 5); cMoviePanel* itemPanel5 = new cMoviePanel(itemPanel1, ID_PANEL, wxDefaultPosition, wxSize(580, 430), wxSIMPLE_BORDER | wxTAB_TRAVERSAL); itemPanel5->SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY); itemPanel5->m_GotoNextPanel = PANEL_ENFORCEMENTFULL; //itemPanel5->m_isPlay = false; itemBoxSizer4->Add(itemPanel5, 1, wxGROW | wxALL, 0); wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); itemBoxSizer3->Add(itemBoxSizer6, 0, wxALIGN_TOP | wxALL, 5); cBitmap3ButtonEx* itemButton7 = new cBitmap3ButtonEx(itemPanel1, ID_BUTTON_CANCEL, g_controller.m_ResoucePath[ "fullcancel_button"], wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxStaticText* itemStaticText8 = new wxStaticText(itemPanel1, wxID_STATIC, _("Static Text"), wxDefaultPosition, wxDefaultSize, 0); itemStaticText8->SetForegroundColour(wxColour(255, 255, 128)); itemStaticText8->SetFont(wxFont(18, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT(""))); itemBoxSizer6->Add(itemStaticText8, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxStaticBitmap* itemStaticBitmap9 = new wxStaticBitmap(itemPanel1, wxID_STATIC, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer6->Add(itemStaticBitmap9, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); wxStaticText* itemStaticText10 = new wxStaticText(itemPanel1, wxID_STATIC, _("Static Text"), wxDefaultPosition, wxDefaultSize, 0); itemStaticText10->SetForegroundColour(wxColour(255, 255, 128)); itemStaticText10->SetFont(wxFont(18, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT(""))); itemBoxSizer6->Add(itemStaticText10, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// m_captureNumber = itemStaticText8; m_captureSpeed = itemStaticText10; m_captureImage = itemStaticBitmap9; UpdatePanel(_("9991"), _("124 km/h"), _("movie/bmp1.bmp")); }
void CLibraryFrame::SetPanelData(CMetaList* pPanel) { if ( ! HasPanel() ) return; // Panel is hidden if ( m_pPanel->IsKindOf( RUNTIME_CLASS( CLibraryMetaPanel ) ) ) { CLibraryMetaPanel* pDataPanel = static_cast< CLibraryMetaPanel* >( m_pPanel ); if ( pDataPanel ) { pDataPanel->SetServicePanel( pPanel ); UpdatePanel( TRUE ); } } }
LPanel::LPanel(QSettings *file, int scr, int num, QWidget *parent) : QWidget(){ //Take care of inputs this->setMouseTracking(true); if(DEBUG){ qDebug() << " - Creating Panel:" << scr << num; } bgWindow = parent; //save for later tmpID = 0; //Setup the widget overlay for the entire panel to provide transparency effects panelArea = new QWidget(this); QBoxLayout *tmp = new QBoxLayout(QBoxLayout::LeftToRight); tmp->setContentsMargins(0,0,0,0); this->setLayout(tmp); tmp->addWidget(panelArea); settings = file; screennum = scr; panelnum = num; //save for later screen = LSession::desktop(); PPREFIX = "panel"+QString::number(screennum)+"."+QString::number(num)+"/"; defaultpanel = (screen->screenGeometry(screennum).x()==0 && num==0); horizontal=true; //use this by default initially hidden = false; //use this by default //Setup the panel if(DEBUG){ qDebug() << " -- Setup Panel"; } this->setContentsMargins(0,0,0,0); this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); //panels cannot get keyboard focus otherwise it upsets the task manager window detection this->setAttribute(Qt::WA_X11DoNotAcceptFocus); this->setAttribute(Qt::WA_X11NetWmWindowTypeDock); this->setAttribute(Qt::WA_AlwaysShowToolTips); this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); this->setWindowTitle("LuminaPanel"); this->setObjectName("LuminaPanelBackgroundWidget"); this->setStyleSheet("QToolButton::menu-indicator{ image: none; }"); panelArea->setObjectName("LuminaPanelColor"); layout = new QBoxLayout(QBoxLayout::LeftToRight); layout->setContentsMargins(0,0,0,0); layout->setSpacing(1); //layout->setSizeConstraint(QLayout::SetFixedSize); panelArea->setLayout(layout); //Set special window flags on the panel for proper usage this->show(); //this->setFocusPolicy(Qt::NoFocus); LSession::handle()->XCB->SetAsSticky(this->winId()); //LSession::handle()->XCB->SetAsPanel(this->winId()); LX11::SetAsPanel(this->winId()); QTimer::singleShot(1,this, SLOT(UpdatePanel()) ); //start this in a new thread connect(screen, SIGNAL(resized(int)), this, SLOT(UpdatePanel()) ); //in case the screen resolution changes }
void LDesktop::UpdatePanels(){ qDebug() << " - Update Panels"; int panels = settings->value(DPREFIX+"panels", 0).toInt(); //if(panels==0 && defaultdesktop){ panels=1; } //need at least 1 panel on the primary desktop for(int i=0; i<panels; i++){ if(i<PANELS.length()){ qDebug() << " -- Update panel "<< i; //panel already exists - just update it QTimer::singleShot(1, PANELS[i], SLOT(UpdatePanel()) ); }else{ qDebug() << " -- Create panel "<< i; //New panel PANELS << new LPanel(settings, desktopnumber, i); } } }
AnimationFrame::AnimationFrame(std::function<void ()> onClose, wxDocument *doc, wxView *view, wxFrame *parent, const wxSize& size) : #if defined(BUILD_FOR_VIEWER) && (BUILD_FOR_VIEWER != 0) wxDocChildFrame(doc, view, parent, wxID_ANY, wxT("CalChart Viewer"), wxDefaultPosition, size), #else wxFrame(parent, wxID_ANY, wxT("CalChart Viewer"), wxDefaultPosition, size), #endif mCanvas(NULL), mOmniViewCanvas(NULL), mTimer(new wxTimer(this, CALCHART__anim_next_beat_timer)), mTempo(120), mTimerOn(false), mWhenClosed(onClose) { // Give it an icon // give this a view so it can pick up document changes mAnimationView = new AnimationView(); mAnimationView->SetDocument(doc); mAnimationView->SetFrame(this); SetBandIcon(this); // this frame has 2 status bars at the bottom CreateStatusBar(2); // Make a menubar wxMenu *anim_menu = new wxMenu; anim_menu->Append(CALCHART__anim_reanimate, wxT("&Reanimate Show...\tCTRL-RETURN"), wxT("Regenerate animation")); anim_menu->Append(CALCHART__anim_select_coll, wxT("&Select Collisions"), wxT("Select colliding points")); anim_menu->Append(wxID_CLOSE, wxT("&Close Window\tCTRL-W"), wxT("Close window")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(anim_menu, wxT("&Animate")); wxMenu *omni_menu = new wxMenu; omni_menu->Append(CALCHART__FollowMarcher, wxT("&Follow Marcher"), wxT("Follow Marcher")); omni_menu->Append(CALCHART__ToggleCrowd, wxT("&Toggle Crowd"), wxT("Toggle Crowd")); omni_menu->Append(CALCHART__ToggleMarching, wxT("&Toggle Marching"), wxT("Toggle Marching")); omni_menu->Append(CALCHART__ToggleShowOnlySelected, wxT("&Toggle Show Selected"), wxT("Toggle Show Selected")); omni_menu->Append(CALCHART__ShowKeyboardControls, wxT("&Show Controls"), wxT("Show keyboard controls")); menu_bar->Append(omni_menu, wxT("&OmniView")); wxMenu *split_menu = new wxMenu; split_menu->Append(CALCHART__SplitViewHorizontal, wxT("Split &Horizontally\tCtrl-H"), wxT("Split Horizontally")); split_menu->Append(CALCHART__SplitViewVertical, wxT("Split &Vertically\tCtrl-V"), wxT("Split Vertically")); split_menu->Append(CALCHART__SplitViewUnsplit, wxT("&Unsplit\tCtrl-U"), wxT("Unsplit")); split_menu->Append(CALCHART__SplitViewSwapAnimateAndOmni, wxT("&Swap Views\tCtrl-S"), wxT("Swap Views")); menu_bar->Append(split_menu, wxT("&Split")); SetMenuBar(menu_bar); // Add a toolbar // Add the field canvas here so that it gets the focus when we switch to frame. mSplitter = new wxSplitterWindow(this, wxID_ANY); mSplitter->SetSize(GetClientSize()); mSplitter->SetSashGravity(0.5); mSplitter->SetMinimumPaneSize(20); mSplitter->SetWindowStyleFlag(mSplitter->GetWindowStyleFlag() | wxSP_LIVE_UPDATE); mSplitter->SetMinSize(wxSize(300, 400)); mOmniViewCanvas = new CCOmniView_Canvas(mAnimationView, mSplitter); mCanvas = new AnimationCanvas(mAnimationView, mSplitter); mSplitA = mOmniViewCanvas; mSplitB = mCanvas; if (!GetConfiguration_AnimationFrameOmniAnimation()) { std::swap(mSplitA, mSplitB); } mSplitter->Initialize(mSplitA); if (GetConfiguration_AnimationFrameSplitScreen()) { if (GetConfiguration_AnimationFrameSplitVertical()) { mSplitter->SplitVertically(mSplitA, mSplitB); } else { mSplitter->SplitHorizontally(mSplitA, mSplitB); } } mSplitter->SetSashPosition(GetConfiguration_AnimationFrameSashPosition()); AddCoolToolBar(GetAnimationToolBar(), *this); // set up the frame this->SetSizeHints(wxDefaultSize, wxDefaultSize); this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_MENU)); wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *toprow = new wxBoxSizer(wxHORIZONTAL); wxSizerFlags topRowSizerFlags = wxSizerFlags(0).Expand().Border(0, 5); wxSizerFlags centerText = wxSizerFlags(0).Border(wxALL, 5).Align(wxALIGN_CENTER_HORIZONTAL); wxSizerFlags centerWidget = wxSizerFlags(0).Expand().Border(wxALL, 5).Align(wxALIGN_CENTER_HORIZONTAL); // Add the controls wxBoxSizer *sizer1 = new wxBoxSizer(wxVERTICAL); sizer1->Add(new wxStaticText(this, wxID_ANY, wxT("Collisions")), centerText); static const wxString collis_text[] = { wxT("Ignore"), wxT("Show"), wxT("Beep") }; wxChoice *collis = new wxChoice(this, CALCHART__anim_collisions, wxDefaultPosition, wxDefaultSize, sizeof(collis_text)/sizeof(const wxString), collis_text); collis->SetSelection(mAnimationView->GetCollisionType()); sizer1->Add(collis, centerWidget); toprow->Add(sizer1, topRowSizerFlags); sizer1 = new wxBoxSizer(wxVERTICAL); sizer1->Add(new wxStaticText(this, wxID_ANY, wxT("Tempo")), centerText); // defect 3538572: Callings set may update tempo, cache value before call. unsigned tmp = GetTempo(); wxSpinCtrl *tempo = new wxSpinCtrl(this, CALCHART__anim_tempo); tempo->SetRange(10, 300); tempo->SetValue(tmp); SetTempo(tmp); sizer1->Add(tempo, centerWidget); toprow->Add(sizer1, topRowSizerFlags); // Sheet slider (will get set later with UpdatePanel()) sizer1 = new wxBoxSizer(wxVERTICAL); sizer1->Add(new wxStaticText(this, wxID_ANY, wxT("Sheet")), centerText); mSheetSlider = new wxSlider(this, CALCHART__anim_gotosheet, 1, 1, 2, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS); sizer1->Add(mSheetSlider, centerWidget); toprow->Add(sizer1, topRowSizerFlags); // Beat slider (will get set later with UpdatePanel()) sizer1 = new wxBoxSizer(wxVERTICAL); sizer1->Add(new wxStaticText(this, wxID_ANY, wxT("Beat")), centerText); mBeatSlider = new wxSlider(this, CALCHART__anim_gotobeat, 0, 0, 1, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL | wxSL_LABELS); sizer1->Add(mBeatSlider, centerWidget); toprow->Add(sizer1, topRowSizerFlags); sizer1 = new wxBoxSizer(wxVERTICAL); mErrorList = new wxChoice(this, CALCHART__anim_errors, wxDefaultPosition, wxDefaultSize, 0, NULL); mErrorList->Append(wxT("Errors...")); mErrorList->SetSelection(0); sizer1->Add(mErrorList, centerWidget); mErrorText = new FancyTextWin(this, wxID_ANY); sizer1->Add(mErrorText, wxSizerFlags(1).Expand().Border(wxALL, 5).Align(wxALIGN_CENTER_HORIZONTAL)); toprow->Add(sizer1, topRowSizerFlags); topsizer->Add(toprow, wxSizerFlags(0).Border(0, 5)); // Add the field canvas topsizer->Add(mSplitter, wxSizerFlags(1).Expand()); SetSizer( topsizer ); topsizer->SetSizeHints(this); // set size hints to honour minimum size this->Layout(); mAnimationView->Generate(); UpdatePanel(); Fit(); SetSize(size); Show(true); // make animation screen large by default. // Maximize(true); }
BOOL EditService(CServiceManager* sm) { PanelInfo pi; ZeroMemory(&pi, sizeof(PanelInfo)); pi.StructSize = sizeof(PanelInfo); if (Info.PanelControl(PANEL_ACTIVE, FCTL_GETPANELINFO, 0, &pi)) { size_t CurItem = pi.CurrentItem; if (CurItem > 0) { size_t Size = Info.PanelControl(PANEL_ACTIVE, FCTL_GETPANELITEM, CurItem, 0); PluginPanelItem *PPI=(PluginPanelItem*)malloc(Size); if (PPI) { FarGetPluginPanelItem FGPPI = {Size, PPI}; Info.PanelControl(PANEL_ACTIVE, FCTL_GETPANELITEM, CurItem, &FGPPI); size_t Index = FGPPI.Item->UserData; free(PPI); if (Index < sm->GetCount()) { if (sm->GetType() == 0) return TRUE; CServiceInfo& rServiceInfo = sm->GetServiceInfo(Index); PluginDialogBuilder Dlg(Info, PluginGuid, EditServiceDlgGuid, L"Service Properties", NULL); wstring sService = L"Service: " + rServiceInfo.iDisplayName; Dlg.AddEmptyLine(); Dlg.AddText(sService.c_str()); int nStartType = rServiceInfo.iStartType; int nStartTypeCount = 0; int nStartTypeMessages[] = {MBoot, MSystem, MAutomatic, MManual, MDisabled}; int* pStartTypeMessages = NULL; if (sm->GetType() == SERVICE_WIN32) { nStartTypeCount = 3; nStartType -= 2; pStartTypeMessages = nStartTypeMessages + 2; } else if (sm->GetType() == SERVICE_DRIVER) { nStartTypeCount = 5; pStartTypeMessages = nStartTypeMessages; } Dlg.AddEmptyLine(); Dlg.StartSingleBox(MStartupType, true); Dlg.AddRadioButtons(&nStartType, nStartTypeCount, pStartTypeMessages, true); Dlg.EndSingleBox(); Dlg.AddOKCancel(MButtonOk, MButtonCancel); if (Dlg.ShowDialog()) { if (sm->GetType() == SERVICE_WIN32) nStartType += 2; if (nStartType != rServiceInfo.iStartType) { if (sm->SetServiceStartupType(Index, nStartType)) UpdatePanel(); else ShowLastError(&MsgCantSetStartTypeGuid); } } } } } } return TRUE; }
void CLibraryFrame::OnTimer(UINT_PTR /*nIDEvent*/) { if ( m_bViewSelection ) UpdatePanel( FALSE ); }
BOOL CLibraryFrame::Update(BOOL bForce, BOOL bBestView) { CSingleLock pLock( &Library.m_pSection ); if ( ! pLock.Lock( bForce ? 500 : 50 ) ) return FALSE; if ( ! bForce && m_nLibraryCookie == Library.GetCookie() ) return FALSE; m_nLibraryCookie = Library.GetCookie(); m_bUpdating = TRUE; m_nFolderCookie = GetTickCount(); m_wndTree.Update( m_nFolderCookie ); CLibraryTreeItem* pFolderSelection = m_wndTree.GetFirstSelected(); CLibraryView* pFirstView = NULL; CLibraryView* pBestView = NULL; CString strBest; if ( pFolderSelection != NULL && pFolderSelection->m_pVirtual != NULL ) { ASSERT_VALID( pFolderSelection ); strBest = pFolderSelection->m_pVirtual->GetBestView(); } for ( POSITION pos = m_pViews.GetHeadPosition(); pos; ) { CLibraryView* pView = m_pViews.GetNext( pos ); if ( pView->CheckAvailable( m_wndTree.GetFirstSelected() ) ) { CString strViewName( pView->GetRuntimeClass()->m_lpszClassName ); if ( ! pFirstView || ( pFolderSelection && pFolderSelection->m_pPhysical && strViewName.CompareNoCase( Settings.Library.LastUsedView ) == 0 ) ) pFirstView = pView; if ( strViewName.CompareNoCase( strBest ) == 0 ) pBestView = pView; } } int nHeaderSize = m_wndHeader.Update(); if ( bBestView && pBestView ) { if ( pBestView->IsKindOf( RUNTIME_CLASS(CLibraryCollectionView) ) ) nHeaderSize = 0; } if ( nHeaderSize != m_nHeaderSize ) { m_nHeaderSize = nHeaderSize; if ( m_nHeaderSize == 0 ) m_wndHeader.ShowWindow( SW_HIDE ); OnSize( 1982, 0, 0 ); } if ( pFirstView == NULL ) pFirstView = m_pViews.GetTail(); if ( pBestView != NULL && bBestView ) SetView( pBestView, FALSE, FALSE ); else if ( ! HasView() || ! m_pView->m_bAvailable ) SetView( pFirstView, FALSE, FALSE ); else SetView( m_pView, FALSE, FALSE ); UpdatePanel( TRUE ); m_bUpdating = FALSE; return TRUE; }