//------------------------------------------------------------------------------ void BMenuField::SetDivider(float dividing_line) { if (fDivider - dividing_line == 0.0f) return; MenuBar()->MoveBy(dividing_line - fDivider, 0.0f); MenuBar()->ResizeBy(fDivider - dividing_line, 0.0f); fDivider = dividing_line; }
void CSkinManager::RefreshAllSkins(bool bReload) { Combo()->Refresh(); MainFrame()->Refresh(); FavorBar()->Refresh(); MenuBar()->Refresh(); Tab()->Refresh(); Category()->Refresh(); Toolbar()->Refresh(); HelpButton()->Refresh(); LoadButton()->Refresh(); LoginButton()->Refresh(); SepButton()->Refresh(); SettingButton()->Refresh(); BigButton()->Refresh(); SSLLockButton()->Refresh(); StatusBar()->Refresh(); Tooltip()->Refresh(); MenuButton()->Refresh(); LogoButton()->Refresh(); Common()->Refresh(bReload); BackButton()->Refresh(); ForwardButton()->Refresh(); RefreshButton()->Refresh(); CoolMenuSkin()->Refresh(); }
void ArpMenuField::ComputeDimens(ArpDimens& cur_dimens) { BMenu* menu = MenuBar(); BMenu* popup = Menu(); if( menu ) { copy_attrs(menu); copy_attrs(popup); menu->SetFont(&PV_MenuFont); menu->InvalidateLayout(); } get_view_dimens(&cur_dimens, this, false); font_height fhs; BasicFont()->GetHeight(&fhs); const float fh = fhs.ascent+fhs.descent+fhs.leading; float fw = BasicFont()->StringWidth("WWWW"); float pref_w=0; if( popup ) { int32 num = popup->CountItems(); for( int32 i=0; i<num; i++ ) { BMenuItem* item = popup->ItemAt(i); if( item ) { const float w=BasicFont()->StringWidth(item->Label()); ArpD(cdb << ADH << "Dimensions for popup label " << item->Label() << ": " << w << endl); if( w > pref_w ) pref_w = w; } } } cur_dimens.Y().SetTo(0, fh+12, fh+12, fh+12, 0); float labelWidth = (Label() && *Label()) ? BasicFont()->StringWidth(Label()) + BasicFont()->StringWidth(" ") : 0; cur_dimens.X().SetTo(labelWidth, (fw < pref_w ? fw : pref_w) + 20, pref_w + 20, pref_w + 20, 0); }
void ArpMenuField::ParametersChanged(const ArpParamSet* params) { if( params->GetChanges(parameters_menufield)&MENU_PROPS_CHANGED ) { if( MenuBar() ) { copy_attrs(MenuBar()); MenuBar()->SetFont(&PV_MenuFont); MenuBar()->SetHighColor(PV_MenuForeColor); MenuBar()->SetLowColor(PV_MenuBackColor); MenuBar()->SetViewColor(PV_MenuBackColor); } if( Menu() ) { copy_attrs(Menu()); } InvalidateView(); } inherited::ParametersChanged(params); }
// ----------------------------------------------------------------------------- // CLandmarksCategoriesView::DoActivateL // // (other items were commented in a header). // ----------------------------------------------------------------------------- // void CLandmarksCategoriesView::DoActivateL( const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/) { if (!iContainer) { iContainer = new (ELeave) CLandmarksCategoriesContainer( *this, *iEngine, *(MenuBar())); iContainer->SetMopParent(this); iContainer->ConstructL(ClientRect()); } // Enable receiving of keyboard events. AppUi()->AddToStackL(*this, iContainer); // Make view visible. iContainer->MakeVisible(ETrue); // Notify that this view is active. TBool isActive = ETrue; iEngine->NotifyViewActivated(Id(), isActive); }
void InitGraphics() { HINSTANCE hInst = NULL; HWND hWnd; WNDCLASS wc; LPCWSTR window_class = (LPCWSTR)wind_class; // Fill up window structure wc.lpszClassName = window_class; // registration name wc.hInstance = hInst; // application instance wc.lpfnWndProc = (WNDPROC)WinProc; // event handling function wc.hCursor = LoadCursor(NULL, IDC_ARROW); // cursor type wc.hIcon = NULL; wc.lpszMenuName = NULL; // menu, if any wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // background color wc.style = CS_HREDRAW | CS_VREDRAW; // window style wc.cbClsExtra = 0; wc.cbWndExtra = 0; MenuBar(); /* Register window class */ if (!RegisterClass(&wc)) { printf(" Error in RegisterClass...\n"); exit(1); } // Create window hWnd = CreateWindow( window_class, // Desktop window class name L"Lab 2 CCI-36", // window name WS_OVERLAPPEDWINDOW | WS_VISIBLE, // Window class style 0, 0, //window top, left corner(origin) numXpixels, numYpixels, // window X,Y size (HWND)NULL, // Parent window (HMENU)menu, // handle to menu (HINSTANCE)hInst, // handle to application instance (LPVOID)NULL); // pointer to window-creation data if ((hWnd == NULL)) { printf("Error in CreateWindow ...\n "); exit(1); } // Sets the visibility state of window ShowWindow(hWnd, SW_SHOW); // store window handle device context WinHandle = hWnd; hdc = GetDC(WinHandle); // set hpen, blackbrush for clearing window, color for text and text background hpen = CreatePen(PS_SOLID, 1, win_draw_color); SelectObject(hdc, hpen); blackBrush = (HBRUSH)GetStockObject(BLACK_BRUSH); SetBkColor(hdc, RGB(0, 0, 0)); SetTextColor(hdc, RGB(255, 255, 255)); }