void KeyboardWidget::OnResize(const PixelRect &rc) { PrepareSize(rc); ResizeButtons(); MoveButtons(rc); }
void CXTPEditListBoxToolBar::OnWindowPosChanged(WINDOWPOS FAR* lpwndpos) { CStatic::OnWindowPosChanged(lpwndpos); // Move the buttons to their correct location. MoveButtons(); }
KeyboardControl::KeyboardControl(ContainerWindow &parent, const DialogLook &_look, PixelRect rc, OnCharacterCallback_t _on_character, const WindowStyle _style) :look(_look), on_character(_on_character), num_buttons(0) { Create(parent, rc, _style); TCHAR caption[] = _T(" "); for (const TCHAR *i = keyboard_letters; !StringIsEmpty(i); ++i) { caption[0] = *i; AddButton(caption); } AddButton(_T(" Space ")); AddButton(_T(".")); AddButton(_T(",")); AddButton(_T("-")); MoveButtons(); }
void CXTPEditListBoxToolBar::Initialize(bool bAutoFont/*= true*/) { // Create the ToolTip control. m_tooltip.Create(this); m_tooltip.Activate(TRUE); CImageList imageList; imageList.Create(14, 12, ILC_COLOR8 | ILC_MASK, 0, 1); CBitmap bmp; CXTPResourceManager::AssertValid(XTPResourceManager()->LoadBitmap(&bmp, XTP_IDB_LISTEDIT)); imageList.Add(&bmp, RGB(255, 0, 255)); for (int i = 0; i < _countof(m_arButton); ++i) { if ((!m_bShowNewDeleteButtons) && ((i==0) || (i==1))) continue; if ((!m_bShowUpDownButtons) && ((i==2) || (i==3))) continue; if (!m_arButton[i].Create(NULL, WS_CHILD | WS_VISIBLE | BS_ICON | BS_CENTER | BS_VCENTER, CRect(0, 0, 0, 0), this, _arButtonID[i])) { TRACE0("Unable to create edit button.\n"); continue; } m_arIcon[i] = imageList.ExtractIcon(i); m_arButton[i].SetIcon(CSize(0), m_arIcon[i]); CString strToolTip; CXTPResourceManager::AssertValid(XTPResourceManager()->LoadString(&strToolTip, _arButtonID[i])); // Add tooltips to group buttons. m_tooltip.AddTool(&m_arButton[i], strToolTip); // make sure the button is Windows XP theme compatible using // the toolbar button theme. if (m_arButton[i].SetTheme(xtpControlThemeFlat)) { CXTPButtonTheme* pTheme = m_arButton[i].GetTheme(); if (pTheme) { pTheme->EnableToolbarStyle(TRUE); } m_arButton[i].SetUseVisualStyle(TRUE); } } // Move the buttons to their correct location. MoveButtons(); // Set the font for this window. if (bAutoFont) { SetFont(&XTPAuxData().font); } }
void KeyboardControl::OnResize(PixelSize new_size) { button_width = new_size.cx / 10; button_height = new_size.cy / 5; ResizeButtons(); MoveButtons(); }
void KeyboardWidget::OnResize(const PixelRect &rc) { const PixelSize new_size = rc.GetSize(); button_width = new_size.cx / 10; button_height = new_size.cy / 5; ResizeButtons(); MoveButtons(rc); }