int CPlayerColorControlBar::OnCreate(LPCREATESTRUCT lpCreateStruct) { if(__super::OnCreate(lpCreateStruct) == -1) return -1; CRect r; GetClientRect(r); GetSystemFontWithScale(&m_font); csBrightLabel.Create( ResStr(IDS_COLOR_CONTROL_LABEL_BRIGHT),WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE , r, this, IDC_STATIC); csBrightLabel.SetFont(&m_font); csConstLabel.Create( ResStr(IDS_COLOR_CONTROL_LABEL_CONSTANT), WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE, r, this, IDC_STATIC); csConstLabel.SetFont(&m_font); csl_bright.Create( WS_CHILD|WS_VISIBLE|TBS_AUTOTICKS|TBS_HORZ|TBS_NOTICKS , r, this, IDC_SLIDER1); csl_const.Create( WS_CHILD|WS_VISIBLE|TBS_AUTOTICKS|TBS_HORZ|TBS_NOTICKS , r, this, IDC_SLIDER2); cb_reset.Create( ResStr(IDS_COLOR_CONTROL_BUTTON_RESET), WS_VISIBLE|WS_CHILD|BS_FLAT|BS_VCENTER|BS_CENTER, r , this, IDC_BUTTONRESETCOLORCONTROL); cb_reset.SetFont(&m_font); //cb_enablectrl.Create( ResStr(IDS_COLOR_CONTROL_BUTTON_ENABLE), WS_VISIBLE|WS_CHILD|BS_FLAT|BS_VCENTER|BS_CENTER, r , this, IDC_BUTTONENABLECOLORCONTROL); //cb_enablectrl.SetFont(&m_font); Relayout(); CheckAbility(); return 0; }
void CPlayerInfoBar::RemoveAllLines() { m_label.RemoveAll(); m_info.RemoveAll(); Relayout(); }
void CPlayerInfoBar::SetLine(CString label, CString info) { info.Trim(); if (info.IsEmpty()) { RemoveLine(label); return; } for (size_t idx = 0; idx < m_label.GetCount(); idx++) { CString tmp; m_label[idx]->GetWindowText(tmp); if (label == tmp) { m_info[idx]->GetWindowText(tmp); if (info != tmp) { m_info[idx]->SetWindowText(info); m_tooltip.UpdateTipText(info, m_info[idx]); } return; } } CAutoPtr<CStatusLabel> l(DEBUG_NEW CStatusLabel(true, false)); l->Create(label, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SS_OWNERDRAW, CRect(0, 0, 0, 0), this); m_label.Add(l); CAutoPtr<CStatusLabel> i(DEBUG_NEW CStatusLabel(false, true)); i->Create(info, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | SS_OWNERDRAW | SS_NOTIFY, CRect(0, 0, 0, 0), this); m_tooltip.AddTool(i, info); m_info.Add(i); Relayout(); }
void CPlayerStatusBar::OnSize(UINT nType, int cx, int cy) { CDialogBar::OnSize(nType, cx, cy); Invalidate(); Relayout(); }
void BAbstractSpinner::_UpdateFrame() { if (fLayoutData->label_layout_item == NULL || fLayoutData->text_view_layout_item == NULL) { return; } BRect labelFrame = fLayoutData->label_layout_item->Frame(); BRect textViewFrame = fLayoutData->text_view_layout_item->Frame(); if (!labelFrame.IsValid() || !textViewFrame.IsValid()) return; // update divider fDivider = textViewFrame.left - labelFrame.left; BRect frame = textViewFrame | labelFrame; MoveTo(frame.left, frame.top); BSize oldSize = Bounds().Size(); ResizeTo(frame.Width(), frame.Height()); BSize newSize = Bounds().Size(); // If the size changes, ResizeTo() will trigger a relayout, otherwise // we need to do that explicitly. if (newSize != oldSize) Relayout(); }
void BMenuField::SetDivider(float divider) { divider = floorf(divider + 0.5); float dx = fDivider - divider; if (dx == 0.0f) return; fDivider = divider; if (Flags() & B_SUPPORTS_LAYOUT) { // We should never get here, since layout support means, we also // layout the divider, and don't use this method at all. Relayout(); } else { BRect dirty(fMenuBar->Frame()); fMenuBar->MoveTo(_MenuBarOffset(), kVMargin); if (fFixedSizeMB) fMenuBar->ResizeTo(_MenuBarWidth(), dirty.Height()); dirty = dirty | fMenuBar->Frame(); dirty.InsetBy(-kVMargin, -kVMargin); Invalidate(dirty); } }
void BMenuField::_UpdateFrame() { CALLED(); if (fLayoutData->label_layout_item && fLayoutData->menu_bar_layout_item) { BRect labelFrame = fLayoutData->label_layout_item->Frame(); BRect menuFrame = fLayoutData->menu_bar_layout_item->Frame(); // update divider fDivider = menuFrame.left - labelFrame.left; // update our frame MoveTo(labelFrame.left, labelFrame.top); BSize oldSize = Bounds().Size(); ResizeTo(menuFrame.left + menuFrame.Width() - labelFrame.left, menuFrame.top + menuFrame.Height() - labelFrame.top); BSize newSize = Bounds().Size(); // If the size changes, ResizeTo() will trigger a relayout, otherwise // we need to do that explicitly. if (newSize != oldSize) Relayout(); } }
void BTextControl::_UpdateFrame() { CALLED(); if (fLayoutData->text_view_layout_item != NULL) { BRect textFrame = fLayoutData->text_view_layout_item->Frame(); BRect labelFrame; if (fLayoutData->label_layout_item != NULL) labelFrame = fLayoutData->label_layout_item->Frame(); BRect frame; if (labelFrame.IsValid()) { frame = textFrame | labelFrame; // update divider fDivider = fabs(textFrame.left - labelFrame.left); } else { frame = textFrame; fDivider = 0; } MoveTo(frame.left, frame.top); BSize oldSize = Bounds().Size(); ResizeTo(frame.Width(), frame.Height()); BSize newSize = Bounds().Size(); // If the size changes, ResizeTo() will trigger a relayout, otherwise // we need to do that explicitly. if (newSize != oldSize) Relayout(); } }
int SSplitWnd::InsertItem(SSplitPane* pane, int index /*= -1 */) { //禁止重复插入 if (ArrayFind(m_lstPane,pane)!=-1) { SASSERT(FALSE); return -1; } if(index <0 ) { index = (int)m_lstPane.GetCount(); } m_lstPane.InsertAt(index, pane); m_lstPriority.Add(pane); SortPriorityList(m_lstPriority); CRect rcContainer; GetClientRect(&rcContainer); if (!rcContainer.IsRectEmpty()) { PANESIZELIST lstPaneSize; FatchPaneSizeInfo(m_lstPriority, lstPaneSize); const int index = ArrayFind(m_lstPriority,pane); lstPaneSize[index].actural = lstPaneSize[index].preferred; Relayout(rcContainer, lstPaneSize); } return index; }
BOOL SSplitWnd::HidePane(UINT iPane) { if (iPane < 0 || iPane >= m_lstPane.GetCount()) return FALSE; m_lstPane[iPane]->SetVisible(FALSE); Relayout(GetClientRect()); return TRUE; }
void BSplitView::MouseUp(BPoint where) { if (fSplitLayout->StopDraggingSplitter()) { Relayout(); Invalidate(); } }
HRESULT CXStackPanel::SetStackType( EStackPanelType eType ) { if(m_eStackType != eType) { m_eStackType = eType; Relayout(); } return S_OK; }
BOOL CDuiSplitWnd::ShowPanel(int iPane) { if (iPane < 0 || iPane >= m_arrPane.GetCount()) return FALSE; m_arrPane[iPane]->SetVisible(TRUE); Relayout(m_bColMode?layout_vert:layout_horz); NotifyInvalidate(); return TRUE; }
void OpGroup::OnShow(BOOL show) { // If a group is being shown call a re-layout. // This is to make sure that controls that are hidden and shown like in // tabbed dialogs actually get a relayout and show themselves since // invisible controls are normally skipped if (show) Relayout(); }
void SplitView::SetProportionalMode(bool proportional) { if (fProportional == proportional) return; fProportional = proportional; Relayout(); }
void SplitView::SetOrientation(orientation o) { if (o == fOrientation) return; fOrientation = o; Relayout(); }
void CPlayerStatusBar::Clear() { m_status.SetWindowText(_T("")); m_time.SetWindowText(_T("")); SetStatusBitmap(0); SetStatusTypeIcon(0); Relayout(); }
BOOL SSplitWnd::HidePanel(UINT iPane) { if (iPane < 0 || iPane >= m_arrPane.GetCount()) return FALSE; m_arrPane[iPane]->SetVisible(FALSE); Relayout(m_bColMode?layout_vert:layout_horz); Invalidate(); return TRUE; }
void Hotlist::OnItemChanged(OpTreeModel* tree_model, INT32 pos, BOOL sort) { if (ChangeItem(tree_model, pos)) { Relayout(); //save changements in panel order m_selector->WriteContent(); } }
BOOL SSplitWnd::SetPaneInfo( UINT iPane,int nIdealSize,int nMinSize,int nPriority ) { if(iPane>m_arrPane.GetCount()-1) return FALSE; if(nIdealSize!=-1) m_arrPane[iPane]->m_nSizeIdeal=nIdealSize; if(nMinSize!=-1) m_arrPane[iPane]->m_nSizeMin=nMinSize; if(nPriority!=-1) m_arrPane[iPane]->m_nPriority=nPriority; Relayout(m_bColMode?layout_vert:layout_horz); return TRUE; }
void Hotlist::OnItemRemoving(OpTreeModel* tree_model, INT32 pos) { if (RemoveItem(tree_model, pos)) { Relayout(); //save changements in panel order m_selector->WriteContent(); } }
void CPlayerStatusBar::SetStatusMessage(CString str) { str.Trim(); if (GetStatusMessage() != str) { m_status.SetRedraw(FALSE); m_status.SetWindowText(str); m_status.SetRedraw(TRUE); Relayout(); } }
void CPlayerStatusBar::SetStatusTimer(CString str) { str.Trim(); if (GetStatusTimer() != str) { m_time.SetRedraw(FALSE); m_time.SetWindowText(str); m_time.SetRedraw(TRUE); Relayout(); } }
void VDUIBaseWindowW32::FinalizeDialog() { Relayout(); if (mhwnd && GetFocus() == mhwnd) { // must init focus to a control or else shortcuts don't work at first HWND hwndFirstFocus = GetNextDlgTabItem(mhwnd, NULL, FALSE); if (hwndFirstFocus) ::SetFocus(hwndFirstFocus); } }
Controller::Controller(Controller::WindowCreator const& create_window) : use_primary(false) , create_window_(create_window) , monitor_(0) , visible_(false) , dbus_server_(dbus::BUS_NAME) , ensure_timeout_(PRELOAD_TIMEOUT_LENGTH) , timeline_animator_(90) { RegisterUBusInterests(); ensure_timeout_.Run([this]() { EnsureDash(); return false; }); timeline_animator_.updated.connect(sigc::mem_fun(this, &Controller::OnViewShowHideFrame)); // As a default. the create_window_ function should just create a base window. if (create_window_ == nullptr) { create_window_ = [this]() { return new ResizingBaseWindow(dash::window_title, [this](nux::Geometry const& geo) { if (view_) return GetInputWindowGeometry(); return geo; }); }; } SetupWindow(); UScreen::GetDefault()->changed.connect([this] (int, std::vector<nux::Geometry> const&) { Relayout(true); }); form_factor_changed_ = Settings::Instance().form_factor.changed.connect([this] (FormFactor) { if (window_ && view_ && visible_) { // Relayout here so the input window size updates. Relayout(); window_->PushToFront(); window_->SetInputFocus(); nux::GetWindowCompositor().SetKeyFocusArea(view_->default_focus()); } }); auto& wm = WindowManager::Default(); wm.initiate_spread.connect(sigc::mem_fun(this, &Controller::HideDash)); wm.screen_viewport_switch_started.connect(sigc::mem_fun(this, &Controller::HideDash)); dbus_server_.AddObjects(dbus::INTROSPECTION, dbus::PATH); dbus_server_.GetObjects().front()->SetMethodsCallsHandler([this] (std::string const& method, GVariant*) { if (method == "HideDash") HideDash(); return static_cast<GVariant*>(nullptr); }); }
void SplitView::FrameResized(float width, float height) { if (fProportional && fPosition != -1) { fProportion = fPosition / fPreviousSize; fPosition = -1; } fPreviousSize = _Size(); Relayout(); }
void CChildView::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); if (cx <= 0|| cy <= 0) { return; } Relayout(); }
void OpPluginCrashedBar::OnSendingStarted(const OpMessageAddress& address) { if (m_address != address) return; m_spinner->SetType(OpProgressBar::Spinner); m_sending_report = true; Relayout(); }
void SSplitWnd::RemoveItem(SSplitPane * pane) { int index = ArrayFind(m_lstPane,pane); if(index == -1) return; m_lstPane.RemoveAt(index); index = ArrayFind(m_lstPriority,pane); m_lstPriority.RemoveAt(index); Relayout(GetClientRect()); }
void CPlayerStatusBar::SetStatusTimer(CString str) { CString tmp; m_time.GetWindowText(tmp); if (tmp == str) { return; } str.Trim(); m_time.SetWindowText(str); Relayout(); }