BOOL CDynToolBar::RClick(WPARAM wParam, LPARAM lParam, LRESULT* pLResult) { if (bCanConfigure) { Customize(); return TRUE; } return FALSE; }
static void activateCB( Widget w, XtPointer client_data, XtPointer call_data ) { DtControlCallbackStruct *cbs = (DtControlCallbackStruct *) call_data; char *cd; cd = (char *) client_data; /* if any other event besides an activate event invokes this callback, don't invoke any dialogs. Just ignore the event. */ if (cbs->reason != XmCR_ACTIVATE) return; if (strcmp(cd, COLOR) == 0) Customize(style.shell); else if (strcmp(cd, FONT) == 0) popup_fontBB(style.shell); else if (strcmp(cd, BACKDROP) == 0) BackdropDialog (style.shell); else if (strcmp(cd, KEYBOARD) == 0) popup_keyboardBB(style.shell); else if (strcmp(cd, MOUSE) == 0) popup_mouseBB(style.shell); else if (strcmp(cd, BEEP) == 0) popup_audioBB(style.shell); else if (strcmp(cd, SCREEN) == 0) popup_screenBB(style.shell); else if (strcmp(cd, DTWM) == 0) popup_dtwmBB(style.shell); else if (strcmp(cd, STARTUP) == 0) popup_startupBB(style.shell); else if (strcmp(cd, I18N) == 0) popup_i18nBB(style.shell); }
bool wxGenericComboCtrl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // // Note that technically we only support 'default' border and wxNO_BORDER. long border = style & wxBORDER_MASK; int tcBorder = wxNO_BORDER; #if defined(__WXUNIVERSAL__) if ( !border ) border = wxBORDER_SIMPLE; #elif defined(__WXMSW__) if ( !border ) // For XP, have 1-width custom border, for older version use sunken /*if ( wxUxThemeEngine::GetIfActive() ) { border = wxBORDER_NONE; m_widthCustomBorder = 1; } else*/ border = wxBORDER_SUNKEN; #else // // Generic version is optimized for wxGTK // #define UNRELIABLE_TEXTCTRL_BORDER if ( !border ) { if ( style & wxCB_READONLY ) { m_widthCustomBorder = 1; } else { m_widthCustomBorder = 0; tcBorder = 0; } } else { // Have textctrl instead use the border given. tcBorder = border; } // Because we are going to have button outside the border, // let's use wxBORDER_NONE for the whole control. border = wxBORDER_NONE; Customize( wxCC_BUTTON_OUTSIDE_BORDER | wxCC_NO_TEXT_AUTO_SELECT | wxCC_BUTTON_STAYS_DOWN ); #endif style = (style & ~(wxBORDER_MASK)) | border; if ( style & wxCC_STD_BUTTON ) m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; // create main window if ( !wxComboCtrlBase::Create(parent, id, value, pos, size, style | wxFULL_REPAINT_ON_RESIZE, validator, name) ) return false; // Create textctrl, if necessary CreateTextCtrl( tcBorder ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers(); // Set background style for double-buffering, when needed // (cannot use when system draws background automatically) if ( !HasTransparentBackground() ) SetBackgroundStyle( wxBG_STYLE_PAINT ); // SetInitialSize should be called last SetInitialSize(size); return true; }
void ViewerToolBar::OnToolbarCustomize() { Customize(); }
void TaskToolbar::OnToolbarCustomize() { Customize(); }
BOOL CMuleToolbarCtrl::OnCommand(WPARAM wParam, LPARAM /*lParam*/) { switch (wParam) { case MP_SELECTTOOLBARBITMAPDIR:{ TCHAR buffer[MAX_PATH]; _sntprintf(buffer, _countof(buffer), _T("%s"), thePrefs.GetMuleDirectory(EMULE_TOOLBARDIR)); buffer[_countof(buffer) - 1] = _T('\0'); if(SelectDir(m_hWnd, buffer, GetResString(IDS_SELECTTOOLBARBITMAPDIR))) thePrefs.SetMuleDirectory(EMULE_TOOLBARDIR, buffer); break; } case MP_CUSTOMIZETOOLBAR: Customize(); break; case MP_SELECTTOOLBARBITMAP: { // we could also load "*.jpg" here, but because of the typical non solid background of JPGs this // doesn't make sense here. CString strFilter=GetResString(IDS_LOADFILTER_EMTOOLBAR)+ _T(" ("); for (int f = 0; f < _countof(s_apszTBFiles); f++){ if (f > 0) strFilter += _T(';'); strFilter += s_apszTBFiles[f]; } strFilter += _T(")|"); for (int f = 0; f < _countof(s_apszTBFiles); f++){ if (f > 0) strFilter += _T(';'); strFilter += s_apszTBFiles[f]; } strFilter += _T("||"); CFileDialog dialog(TRUE, EMULTB_BASEEXT _T(".bmp"), NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST, strFilter, NULL, 0); if (IDOK == dialog.DoModal()) if(thePrefs.GetToolbarBitmapSettings()!=dialog.GetPathName()) { ChangeToolbarBitmap(dialog.GetPathName(), true); thePrefs.SetToolbarBitmapSettings(dialog.GetPathName()); } break; } case MP_LARGEICONS: m_sizBtnBmp.cx = m_sizBtnBmp.cy = 32; ForceRecalcLayout(); ChangeToolbarBitmap(thePrefs.GetToolbarBitmapSettings(), true); thePrefs.SetToolbarIconSize(m_sizBtnBmp); break; case MP_SMALLICONS: m_sizBtnBmp.cx = m_sizBtnBmp.cy = 16; ForceRecalcLayout(); ChangeToolbarBitmap(thePrefs.GetToolbarBitmapSettings(), true); thePrefs.SetToolbarIconSize(m_sizBtnBmp); break; case MP_NOTEXTLABELS: ForceRecalcLayout(); ChangeTextLabelStyle(NoLabels, true); thePrefs.SetToolbarLabelSettings(NoLabels); break; case MP_TEXTLABELS: ForceRecalcLayout(); ChangeTextLabelStyle(LabelsBelow, true); thePrefs.SetToolbarLabelSettings(LabelsBelow); break; case MP_TEXTLABELSONRIGHT: ForceRecalcLayout(); ChangeTextLabelStyle(LabelsRight, true); thePrefs.SetToolbarLabelSettings(LabelsRight); break; case MP_SELECT_SKIN_DIR:{ TCHAR buffer[MAX_PATH]; _sntprintf(buffer, _countof(buffer), _T("%s"), thePrefs.GetMuleDirectory(EMULE_SKINDIR, false)); buffer[_countof(buffer) - 1] = _T('\0'); if(SelectDir(m_hWnd, buffer, GetResString(IDS_SELSKINPROFILEDIR))) thePrefs.SetMuleDirectory(EMULE_SKINDIR, buffer); break; } case MP_SELECT_SKIN_FILE: { CString strFilter=GetResString(IDS_LOADFILTER_EMSKINFILES) + _T(" ("); for (int f = 0; f < _countof(s_apszSkinFiles); f++){ if (f > 0) strFilter += _T(';'); strFilter += s_apszSkinFiles[f]; } strFilter += _T(")|"); for (int f = 0; f < _countof(s_apszSkinFiles); f++){ if (f > 0) strFilter += _T(';'); strFilter += s_apszSkinFiles[f]; } strFilter += _T("||"); CFileDialog dialog(TRUE, EMULSKIN_BASEEXT _T(".ini"), NULL, OFN_HIDEREADONLY | OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST, strFilter, NULL, 0); if (dialog.DoModal() == IDOK) { if (thePrefs.GetSkinProfile().CompareNoCase(dialog.GetPathName()) != 0) theApp.ApplySkin(dialog.GetPathName()); } break; } default: if (wParam >= MP_TOOLBARBITMAP && wParam < MP_TOOLBARBITMAP + MAX_TOOLBAR_FILES) { if (thePrefs.GetToolbarBitmapSettings().CompareNoCase(m_astrToolbarPaths[wParam-MP_TOOLBARBITMAP]) != 0) { ChangeToolbarBitmap(m_astrToolbarPaths[wParam-MP_TOOLBARBITMAP], true); thePrefs.SetToolbarBitmapSettings(m_astrToolbarPaths[wParam-MP_TOOLBARBITMAP]); } } else if (wParam >= MP_SKIN_PROFILE && wParam < MP_SKIN_PROFILE + MAX_SKIN_FILES) { if (thePrefs.GetSkinProfile().CompareNoCase(m_astrSkinPaths[wParam - MP_SKIN_PROFILE]) != 0) theApp.ApplySkin(m_astrSkinPaths[wParam - MP_SKIN_PROFILE]); } } return true; }
bool wxGenericComboControl::Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // Set border long border = style & wxBORDER_MASK; if ( !border ) { #if defined(__WXUNIVERSAL__) border = wxBORDER_SIMPLE; #elif defined(__WXMSW__) // For XP, have 1-width custom border, for older version use sunken if ( wxUxThemeEngine::GetIfActive() ) { border = wxBORDER_NONE; m_widthCustomBorder = 1; } else border = wxBORDER_SUNKEN; #elif defined(__WXGTK__) border = wxBORDER_NONE; //m_widthCustomBorder = 2; m_widthCustomBorder = 1; #else border = wxBORDER_SIMPLE; #endif style = (style & ~(wxBORDER_MASK)) | border; } #if defined(__WXGTK__) Customize( wxCC_BUTTON_OUTSIDE_BORDER | wxCC_NO_TEXT_AUTO_SELECT ); #endif if ( style & wxCC_STD_BUTTON ) m_iFlags |= wxCC_POPUP_ON_MOUSE_UP; // create main window if ( !wxComboCtrlBase::Create(parent, id, value, pos, size, style | wxFULL_REPAINT_ON_RESIZE, wxDefaultValidator, name) ) return false; // Create textctrl, if necessary CreateTextCtrl( wxNO_BORDER, validator ); // Add keyboard input handlers for main control and textctrl InstallInputHandlers( true ); // Set background SetBackgroundStyle( wxBG_STYLE_CUSTOM ); // for double-buffering // SetBestSize should be called last SetBestSize(size); return true; }