static LRESULT CALLBACK ListViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { struct PickerInfo *pPickerInfo; LRESULT rc = 0; BOOL bHandled = FALSE; WNDPROC pfnParentWndProc; HWND hwndHeaderCtrl = NULL; HFONT hHeaderCtrlFont = NULL; pPickerInfo = GetPickerInfo(hWnd); pfnParentWndProc = pPickerInfo->pfnParentWndProc; switch(message) { case WM_MOUSEMOVE: if (MouseHasBeenMoved()) ShowCursor(TRUE); break; case WM_ERASEBKGND: if (GetBackgroundBitmap()) { rc = ListViewOnErase(hWnd, (HDC) wParam); bHandled = TRUE; } break; case WM_NOTIFY: bHandled = ListViewNotify(hWnd, (LPNMHDR) lParam); break; case WM_SETFONT: hwndHeaderCtrl = ListView_GetHeader(hWnd); if (hwndHeaderCtrl) hHeaderCtrlFont = GetWindowFont(hwndHeaderCtrl); break; case WM_CONTEXTMENU: bHandled = ListViewContextMenu(hWnd, lParam); break; case WM_DESTROY: // Received WM_DESTROY; time to clean up if (pPickerInfo->pCallbacks->pfnSetViewMode) pPickerInfo->pCallbacks->pfnSetViewMode(pPickerInfo->nCurrentViewID); Picker_Free(pPickerInfo); SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR) pfnParentWndProc); SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR) NULL); break; } if (!bHandled) rc = CallParentWndProc(pfnParentWndProc, hWnd, message, wParam, lParam); // If we received WM_SETFONT, reset header ctrl font back to original font if (hwndHeaderCtrl) SetWindowFont(hwndHeaderCtrl, hHeaderCtrlFont, TRUE); return rc; }
INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: { char tmp[256]; CenterWindow(hDlg); hBrush = CreateSolidBrush(RGB(235, 233, 237)); HBITMAP hBmp = (HBITMAP)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_SPLASH), IMAGE_BITMAP, 0, 0, LR_SHARED); SendMessage(GetDlgItem(hDlg, IDC_ABOUT), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBmp); hFont = CreateFont(-11, 0, 0, 0, 400, 0, 0, 0, 0, 3, 2, 1, 34, TEXT("Verdana")); hFontFX = CreateFont(-12, 0, 0, 0, 400, 0, 0, 0, 0, 3, 2, 1, 34, TEXT("Verdana")); SetWindowFont(GetDlgItem(hDlg, IDC_TEXT1), hFont, true); SetWindowFont(GetDlgItem(hDlg, IDC_TEXT2), hFont, true); SetWindowFont(GetDlgItem(hDlg, IDC_TEXT3), hFont, true); SetWindowFont(GetDlgItem(hDlg, IDC_TEXT4), hFont, true); SetWindowFont(GetDlgItem(hDlg, IDC_SICKFX), hFontFX, true); win_set_window_text_utf8(GetDlgItem(hDlg, IDC_BUILD), "Build time: " __DATE__" - " __TIME__""); snprintf(tmp, WINUI_ARRAY_LENGTH(tmp), "Version: %s", MAME_VERSION); win_set_window_text_utf8(GetDlgItem(hDlg, IDC_BUILDVER), tmp); return true; } case WM_CTLCOLORDLG: return (LRESULT) hBrush; case WM_CTLCOLORSTATIC: case WM_CTLCOLORBTN: hDC = (HDC)wParam; SetBkMode(hDC, TRANSPARENT); SetTextColor(hDC, GetSysColor(COLOR_WINDOWTEXT)); if ((HWND)lParam == GetDlgItem(hDlg, IDC_SICKFX)) SetTextColor(hDC, RGB(63, 72, 204)); return (LRESULT) hBrush; case WM_COMMAND: switch (GET_WM_COMMAND_ID(wParam, lParam)) { case IDOK: case IDCANCEL: DeleteObject(hFont); DeleteObject(hFontFX); DeleteObject(hBrush); EndDialog(hDlg, 0); return true; } break; } return false; }
void CInformationPanel::RealizeStyle() { if (m_hwnd!=NULL) { if (m_fUseRichEdit) { SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE); UpdateProgramInfoText(); } else { SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),TRUE); } SendSizeMessage(); Invalidate(); m_Tooltip.SetFont(m_Font.GetHandle()); } }
static void genopt_window_create_osd_frame(HWND container, LPCTSTR title, const int index, const int x, const int y, const int w, const int h) { // Message frame HWND grpBox, lblColor; grpBox = CreateWindow(WC_BUTTON, title, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_GROUPBOX, x, y, w, h, container, NULL, ghInstance, NULL); SetWindowFont(grpBox, fntMain, true); // Enable chkOSD_Enable[index] = CreateWindow(WC_BUTTON, TEXT("Enable"), WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, x+8, y+16, 128, 20, container, NULL, ghInstance, NULL); SetWindowFont(chkOSD_Enable[index], fntMain, true); // Double Sized chkOSD_DoubleSized[index] = CreateWindow(WC_BUTTON, TEXT("Double Sized"), WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, x+8, y+16+20, 128, 20, container, NULL, ghInstance, NULL); SetWindowFont(chkOSD_DoubleSized[index], fntMain, true); // Transparency chkOSD_Transparency[index] = CreateWindow(WC_BUTTON, TEXT("Transparency"), WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX, x+8, y+16+20+20, 128, 20, container, NULL, ghInstance, NULL); SetWindowFont(chkOSD_Transparency[index], fntMain, true); // Color label lblColor = CreateWindow(WC_STATIC, TEXT("Color:"), WS_CHILD | WS_VISIBLE | SS_LEFT, x+8, y+16+20+20+20+2, 36, 20, container, NULL, ghInstance, NULL); SetWindowFont(lblColor, fntMain, true); // Radio buttons for (int i = 0; i < 4; i++) { optOSD_Color[index][i] = CreateWindow( WC_STATIC, NULL, WS_CHILD | WS_VISIBLE | SS_CENTER | SS_OWNERDRAW | SS_NOTIFY, x+8+36+4+(i*(16+8)), y+16+20+20+20+2, 16, 16, container, (HMENU)(0xA000 + ((index * 4) + i)), ghInstance, NULL); } }
void CDateTimeWnd::Init(CDateTimeUI* pOwner) { m_pOwner = pOwner; m_pOwner->m_nDTUpdateFlag = DT_NONE; if (m_hWnd == NULL) { RECT rcPos = CalPos(); UINT uStyle =WS_CHILD|m_pOwner->m_dwStyle;// 修改者:YYM Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE); //lxm,added,修改Date控件日期为横线 if(m_pOwner->m_dwStyle == DTS_SHORTDATECENTURYFORMAT || m_pOwner->m_dwStyle == DTS_SHORTDATEFORMAT) { CDuiString strFormat = _T("yyyy-MM-dd"); ::SendMessage(m_hWnd, DTM_SETFORMAT, 0, (LPARAM)strFormat.GetData()); } } if (m_pOwner->GetText().IsEmpty()) ::GetLocalTime(&m_pOwner->m_sysTime); ::SendMessage(m_hWnd, DTM_SETSYSTEMTIME, 0, (LPARAM)&m_pOwner->m_sysTime); ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); ::SetFocus(m_hWnd); // // SYSTEMTIME sysTimes[2]; // GetLocalTime(&(sysTimes[0])); // DateTime_SetRange(m_hWnd,GDTR_MIN,sysTimes ); m_bInit = true; }
void TFlatComboBox::SetupWindow() { TComboBox::SetupWindow(); SetExtendedUI(true); SetWindowFont((HFONT)GetStockObject(ANSI_VAR_FONT), true); }
bool CInformationPanel::CreateProgramInfoEdit() { if (m_hwnd==NULL || m_hwndProgramInfo!=NULL) return false; if (m_fUseRichEdit) { m_RichEditUtil.LoadRichEditLib(); m_hwndProgramInfo=::CreateWindowEx(0,m_RichEditUtil.GetWindowClassName(),TEXT(""), WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL | ES_NOHIDESEL, 0,0,0,0,m_hwnd,reinterpret_cast<HMENU>(IDC_PROGRAMINFO),m_hinst,NULL); if (m_hwndProgramInfo==NULL) return false; ::SendMessage(m_hwndProgramInfo,EM_SETEVENTMASK,0,ENM_MOUSEEVENTS | ENM_LINK); ::SendMessage(m_hwndProgramInfo,EM_SETBKGNDCOLOR,0, (COLORREF)m_Theme.ProgramInfoStyle.Back.Fill.GetSolidColor()); m_fProgramInfoCursorOverLink=false; } else { m_hwndProgramInfo=::CreateWindowEx(0,TEXT("EDIT"),TEXT(""), WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, 0,0,0,0,m_hwnd,reinterpret_cast<HMENU>(IDC_PROGRAMINFO),m_hinst,NULL); if (m_hwndProgramInfo==NULL) return false; m_ProgramInfoSubclass.SetSubclass(m_hwndProgramInfo); } SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE); UpdateProgramInfoText(); return true; }
static BOOL Cls_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { HWND hwndChild; TCHAR szFormat[64], szBuffer[64]; #ifndef WIN32 hwndChild = GetFirstChild(hwnd); while (hwndChild) { SetWindowFont(hwndChild, hFontDialog, FALSE); hwndChild = GetNextSibling(hwndChild); } #endif LoadString(hInstance, IDS_MIO_TITLE, szFormat, SIZEOF_IN_CHAR(szFormat)); wsprintf(szBuffer, szFormat, wMIOSlotNumber); SetWindowText(hwnd, szBuffer); if (hwndChild = GetDlgItem(hwnd, IDC_MIO_TYPE)) { SetWindowWord(hwndChild, GWW_TRAYLEVEL, 1000); SetWindowText(hwndChild, mio_card[wMIOSlotNumber - 1].mioType); } if (hwndChild = GetDlgItem(hwnd, IDC_MIO_DESCRIPTION)) { SetWindowWord(hwndChild, GWW_TRAYLEVEL, 1000); SetWindowText(hwndChild, mio_card[wMIOSlotNumber - 1].mioInfo); } return TRUE; }
BOOL CMsgReplayWnd::bCreateReplayWindow() { INT nReturn = 0; // If the co-ordiantes are not correct, calculate the default value CRect omRect; if (m_sWndPlacement.length == 0) { AfxGetApp()->GetMainWnd()->GetWindowPlacement(&m_sWndPlacement); } CString omStrTitle = _(defSTR_REPLAY_WINDOW_TITLE) + m_ouReplayDetails.m_ouReplayFile.m_omStrFileName; nReturn = Create( nullptr, omStrTitle, WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, m_sWndPlacement.rcNormalPosition, nullptr, nullptr ); SetWindowFont(); SendMessage(WM_NCPAINT, 1, 0); // Update Window Pointer in the Replay information object m_ouReplayDetails.m_pReplayWndPtr = this; // Update window with paint UpdateWindow(); return nReturn; }
static void ShowCurItemHint (HWND hWnd, PCOOL_INDICATOR_CTRL cb) { COOL_INDICATOR_ITEMDATA* tmpdata; PCOOL_INDICATOR_CTRL TbarData = (PCOOL_INDICATOR_CTRL) GetWindowAdditionalData2(hWnd); int x, y; tmpdata = GetCurSel(cb); if(tmpdata == NULL) return; x = tmpdata->hintx; y = tmpdata->hinty; if (tmpdata->Hint [0] == '\0') return; ClientToScreen (hWnd, &x, &y); if (g_rcScr.bottom - y < y - g_rcScr.top) { y -= (GetSysCharHeight () + (2 << 1) + cb->ItemHeight); } if (TbarData->hToolTip == 0) { TbarData->hToolTip = CreateCdrToolTipWin (hWnd, x, y, 1000, tmpdata->Hint); SetWindowFont(TbarData->hToolTip, GetWindowFont(hWnd)); } else { ResetCdrToolTipWin (TbarData->hToolTip, x, y, tmpdata->Hint); } }
void CIPAddressWnd::Init(CIPAddressUI* pOwner) { m_pOwner = pOwner; m_pOwner->m_nIPUpdateFlag = IP_NONE; if (m_hWnd == NULL) { INITCOMMONCONTROLSEX CommCtrl; CommCtrl.dwSize=sizeof(CommCtrl); CommCtrl.dwICC=ICC_INTERNET_CLASSES;//指定Class if(InitCommonControlsEx(&CommCtrl)) { RECT rcPos = CalPos(); UINT uStyle = WS_CHILD | WS_TABSTOP | WS_GROUP; Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); } SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE); } if (m_pOwner->GetText().IsEmpty()) m_pOwner->m_dwIP = GetLocalIpAddress(); ::SendMessage(m_hWnd, IPM_SETADDRESS, 0, m_pOwner->m_dwIP); ::ShowWindow(m_hWnd, SW_SHOW); ::SetFocus(m_hWnd); m_bInit = true; }
int CheckBox::make_dialog_gadgets( HWND hPanel ) { assert( _td ); assert( hPanel ); assert( hInstance ); assert( _td->name ); int wLabel = uiDialog::make_dialog_gadgets( hPanel ); hwndCheckbox = theAttributes.CreateWindowEx( 0, "BUTTON", _td->xdata.displayName, 0 | WS_TABSTOP | BS_AUTOCHECKBOX, 5 + wLabel, theAttributes.y, 16, // width 16, // height hPanel ); assert( hwndCheckbox ); SetWindowFont( hwndCheckbox, (HFONT)theAttributes.ip->GetIObjParam()->GetAppHFont(), TRUE ); reset(); return 5 + wLabel + 16; }
void CPathEditWnd::Init( CPathEditUI* pOwner ) { m_pOwner = pOwner; RECT rcPos = CalPos(); UINT uStyle = WS_CHILD | ES_AUTOHSCROLL; if( m_pOwner->IsPasswordMode() ) uStyle |= ES_PASSWORD; Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); HFONT hFont=NULL; int iFontIndex=m_pOwner->GetFont(); if (iFontIndex!=-1) hFont=m_pOwner->GetManager()->GetFont(iFontIndex); if (hFont==NULL) hFont=m_pOwner->GetManager()->GetDefaultFontInfo()->hFont; SetWindowFont(m_hWnd, hFont, TRUE); Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar()); if( m_pOwner->IsPasswordMode() ) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar()); Edit_SetText(m_hWnd, m_pOwner->GetText()); Edit_SetModify(m_hWnd, FALSE); SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0)); Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true); Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true); //Styls LONG styleValue = ::GetWindowLong(m_hWnd, GWL_STYLE); styleValue |= pOwner->GetWindowStyls(); ::SetWindowLong(GetHWND(), GWL_STYLE, styleValue); ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); ::SetFocus(m_hWnd); m_bInit = true; }
void CEditWnd::Init(CEditUI* pOwner) { m_pOwner = pOwner; RECT rcPos = CalPos(); UINT uStyle = WS_CHILD | ES_AUTOHSCROLL; if (m_pOwner->IsPasswordMode()) uStyle |= ES_PASSWORD; Create(m_pOwner->GetManager()->GetPaintWindow(), NULL, uStyle, 0, rcPos); SetWindowFont(m_hWnd, m_pOwner->GetManager()->GetFontInfo(m_pOwner->GetFont())->hFont, TRUE); Edit_LimitText(m_hWnd, m_pOwner->GetMaxChar()); if (m_pOwner->IsPasswordMode()) Edit_SetPasswordChar(m_hWnd, m_pOwner->GetPasswordChar()); Edit_SetText(m_hWnd, m_pOwner->GetText()); Edit_SetModify(m_hWnd, FALSE); SendMessage(EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELPARAM(0, 0)); Edit_Enable(m_hWnd, m_pOwner->IsEnabled() == true); Edit_SetReadOnly(m_hWnd, m_pOwner->IsReadOnly() == true); ::ShowWindow(m_hWnd, SW_SHOWNOACTIVATE); ::SetFocus(m_hWnd); m_bInit = true; }
void IRA_Dialog::SetFont(HWND hwndCtl, HFONT hfont, BOOL fRedraw) { // This messed up the colors and did some whacky recursion without the if // Damn it dude if(fRedraw) SetWindowFont(hwndCtl, hfont, fRedraw); }
bool CInformationPanel::SetFont(const LOGFONT *pFont) { if (!m_Font.Create(pFont)) return false; if (m_hwnd!=NULL) { CalcFontHeight(); if (m_fUseRichEdit) { SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE); UpdateProgramInfoText(); } else { SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),TRUE); } SendSizeMessage(); Invalidate(); } return true; }
BOOL CALLBACK CharNameDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { HWND hName, hDesc; switch (message) { case WM_INITDIALOG: // Fiddle with "name" edit box hName = GetDlgItem(hDlg, IDC_NAME); SetWindowFont(hName, GetFont(FONT_INPUT), FALSE); Edit_LimitText(hName, MAX_CHARNAME); // Fiddle with "description" edit box hDesc = GetDlgItem(hDlg, IDC_DESCRIPTION); SetWindowFont(hDesc, GetFont(FONT_INPUT), FALSE); Edit_LimitText(hDesc, MAX_DESCRIPTION - 1); hTabPage = hDlg; SetFocus(hName); CenterWindow(hMakeCharDialog, GetParent(hMakeCharDialog)); break; HANDLE_MSG(hDlg, WM_COMMAND, CharTabPageCommand); case WM_NOTIFY: switch (((LPNMHDR) lParam)->code) { case PSN_SETACTIVE: SetFocus(GetDlgItem(hDlg, IDC_NAME)); break; case PSN_APPLY: VerifySettings(); // Don't quit dialog until we hear result from server SetWindowLong(hDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); break; } return TRUE; } return FALSE; }
static int TimeEditorWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam) { switch (message) { case MSG_CREATE: { HWND hwnd; HDC hdc; HWND timeedit, spin; SIZE size; hwnd = CreateWindow (CTRL_STATIC, PROMPT, WS_CHILD | WS_VISIBLE | SS_LEFT, IDC_STATIC, 10, 10, 210, 200, hWnd, 0); timefont = CreateLogFont (NULL, "System", "ISO8859-1", FONT_WEIGHT_BOOK, FONT_SLANT_ROMAN, FONT_FLIP_NIL, FONT_OTHER_AUTOSCALE, FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE, 32, 0); hdc = GetClientDC (hWnd); SelectFont (hdc, timefont); GetTextExtent (hdc, "00:00:00", -1, &size); ReleaseDC (hdc); timeedit = CreateWindow (CTRL_SLEDIT, "00:00:00", WS_CHILD | WS_VISIBLE | ES_BASELINE, IDC_EDIT, 40, 220, size.cx + 4, size.cy + 4, hWnd, 0); SetWindowFont (timeedit, timefont); old_edit_proc = SetWindowCallbackProc (timeedit, TimeEditBox); spin = CreateWindow (CTRL_SPINBOX, "", WS_CHILD | WS_VISIBLE, IDC_SPINBOX, 40 + size.cx + 6, 220 + (size.cy - 14) / 2, 20, 20, hWnd, 0); SendMessage (spin, SPM_SETTARGET, 0, timeedit); break; } case MSG_DESTROY: DestroyAllControls (hWnd); DestroyLogFont (timefont); return 0; case MSG_CLOSE: DestroyMainWindow (hWnd); PostQuitMessage (hWnd); return 0; } return DefaultMainWinProc (hWnd, message, wParam, lParam); }
/* * Function: Set font of all dialog items. * * Parameters: * hwnd - the dialog to set the font of */ void set_dialog_font(HWND hwnd, HFONT hfont) { hwnd = GetWindow(hwnd, GW_CHILD); while (hwnd != NULL) { SetWindowFont(hwnd, hfont, 0); hwnd = GetWindow(hwnd, GW_HWNDNEXT); } }
bool mIRCLinker::setTreeFont(HFONT newFont) { HFONT f = GetWindowFont(m_hTreeview); if (m_hTreeFont == NULL) m_hTreeFont = f; SetWindowFont( m_hTreeview, newFont, TRUE); if (f != m_hTreeFont) DeleteFont(f); return true; }
LRESULT EvcSolverPropPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { m_hCapCombo = GetDlgItem(IDC_COMBO_CAPACITY); m_hCostCombo = GetDlgItem(IDC_COMBO_COST); m_hComboMethod = GetDlgItem(IDC_COMBO_METHOD); m_hComboTrafficModel = GetDlgItem(IDC_COMBO_TRAFFICMODEL); m_hEditCritical = GetDlgItem(IDC_EDIT_Critical); m_hEditSat = GetDlgItem(IDC_EDIT_SAT); m_hSeparable = GetDlgItem(IDC_CHECK_SEPARABLE); m_hEdgeStat = GetDlgItem(IDC_CHECK_EDGESTAT); m_hEditDensity = GetDlgItem(IDC_EDIT_ZoneDensity); m_hEditSnapFlock = GetDlgItem(IDC_EDIT_FlockSnapInterval); m_hEditSimulationFlock = GetDlgItem(IDC_EDIT_FlockSimulationInterval); m_hCheckFlock = GetDlgItem(IDC_CHECK_Flock); m_hCheckShareCap = GetDlgItem(IDC_CHECK_SHARECAP); m_hEditInitCost = GetDlgItem(IDC_EDIT_INITDELAY); m_hCmbFlockProfile = GetDlgItem(IDC_COMBO_PROFILE); m_heditCARMA = GetDlgItem(IDC_EDIT_CARMA); m_hThreeGenCARMA = GetDlgItem(IDL_CHECK_CARMAGEN); m_heditSelfish = GetDlgItem(IDC_EDIT_SELFISH); m_heditIterative = GetDlgItem(IDC_EDIT_Iterative); m_hCmbCarmaSort = GetDlgItem(IDC_COMBO_CarmaSort); m_hcmbEvcOptions = GetDlgItem(IDC_CMB_GroupOption); m_hUTurnCombo = GetDlgItem(IDC_COMBO_UTurn); m_hcmbdynModeOptions = GetDlgItem(IDC_COMBO_DYNMODE); // release date label HWND m_hlblRelease = GetDlgItem(IDC_RELEASE); wchar_t compileDateBuff[500]; swprintf_s(compileDateBuff, 500, L"Release: %s | <a href=\"http://facebook.com/casper4gis\">Like</a> | <a href=\"http://uscssi.maps.arcgis.com/home/item.html?id=5f44a6e361634508bda0214b5066c671\">Info</a> | <a href=\"https://www.dropbox.com/sh/b01zkyb6ka56xiv/oOjJBINPIr\">Download</a>", _T(__DATE__)); ::SendMessage(m_hlblRelease, WM_SETTEXT, NULL, (LPARAM)(compileDateBuff)); swprintf_s(compileDateBuff, 500, L"%s %s", PROJ_NAME, _T(GIT_DESCRIBE)); ::SendMessage(GetDlgItem(IDC_STATIC_Title), WM_SETTEXT, NULL, (LPARAM)(compileDateBuff)); // using bold font for title and gropu boxes HWND groupBoxes[] = { GetDlgItem(IDC_SearchGroup), GetDlgItem(IDC_GeneralOptions), GetDlgItem(IDC_CapacityOptions), GetDlgItem(IDC_FlockOptions), GetDlgItem(IDC_RoutingOptions) }; HFONT boldFont = CreateBoldWindowFont(groupBoxes[0]); HFONT bigFont = CreateBoldWindowFont(groupBoxes[0], true); for (const auto & h : groupBoxes) SetWindowFont(h, boldFont, TRUE); SetWindowFont(GetDlgItem(IDC_STATIC_Title), bigFont, true); return S_OK; }
/* * GuildAllyDialogProc: Dialog procedure for guild alliances dialog. */ BOOL CALLBACK GuildAllyDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) { int flags; switch (message) { case WM_INITDIALOG: hGuildAllyDialog = hDlg; flags = guild_info->flags; if (!(flags & GC_MAKE_ALLIANCE)) { DestroyWindow(GetDlgItem(hDlg, IDC_ALLY)); DestroyWindow(GetDlgItem(hDlg, IDC_ALLYLABEL)); } if (!(flags & GC_END_ALLIANCE)) DestroyWindow(GetDlgItem(hDlg, IDC_UNALLY)); if (!(flags & GC_DECLARE_ENEMY)) DestroyWindow(GetDlgItem(hDlg, IDC_ENEMY)); if (!(flags & GC_END_ENEMY)) DestroyWindow(GetDlgItem(hDlg, IDC_UNENEMY)); SetWindowFont(GetDlgItem(hDlg, IDC_GUILDS), GetFont(FONT_LIST), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_ALLYGUILDS), GetFont(FONT_LIST), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_ENEMYGUILDS), GetFont(FONT_LIST), FALSE); RequestGuildList(); return TRUE; HANDLE_MSG(hDlg, WM_COMMAND, GuildAllyCommand); case WM_DESTROY: hGuildAllyDialog = NULL; allies = IDListDelete(allies); enemies = IDListDelete(enemies); return TRUE; } return FALSE; }
GuiCheckButton GuiCheckButton_create (GuiForm parent, int left, int right, int top, int bottom, const wchar_t *buttonText, void (*valueChangedCallback) (void *boss, GuiCheckButtonEvent event), void *valueChangedBoss, unsigned long flags) { GuiCheckButton me = Thing_new (GuiCheckButton); my d_shell = parent -> d_shell; my d_parent = parent; my d_valueChangedCallback = valueChangedCallback; my d_valueChangedBoss = valueChangedBoss; #if gtk my d_widget = gtk_check_button_new_with_label (Melder_peekWcsToUtf8 (buttonText)); _GuiObject_setUserData (my d_widget, me); my v_positionInForm (my d_widget, left, right, top, bottom, parent); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (my d_widget), (flags & GuiCheckButton_SET) != 0); if (flags & GuiCheckButton_INSENSITIVE) { my f_setSensitive (false); } g_signal_connect (G_OBJECT (my d_widget), "destroy", G_CALLBACK (_GuiGtkCheckButton_destroyCallback), me); my d_valueChangedHandlerId = g_signal_connect (GTK_TOGGLE_BUTTON (my d_widget), "toggled", G_CALLBACK (_GuiGtkCheckButton_valueChangedCallback), me); #elif cocoa #elif win my d_widget = _Gui_initializeWidget (xmToggleButtonWidgetClass, parent -> d_widget, buttonText); _GuiObject_setUserData (my d_widget, me); my d_widget -> isRadioButton = false; my d_widget -> window = CreateWindow (L"button", _GuiWin_expandAmpersands (buttonText), WS_CHILD | BS_AUTOCHECKBOX | WS_CLIPSIBLINGS, my d_widget -> x, my d_widget -> y, my d_widget -> width, my d_widget -> height, my d_widget -> parent -> window, (HMENU) 1, theGui.instance, NULL); SetWindowLongPtr (my d_widget -> window, GWLP_USERDATA, (LONG_PTR) my d_widget); SetWindowFont (my d_widget -> window, GetStockFont (ANSI_VAR_FONT), FALSE); my v_positionInForm (my d_widget, left, right, top, bottom, parent); if (flags & GuiCheckButton_SET) { Button_SetCheck (my d_widget -> window, BST_CHECKED); } if (flags & GuiCheckButton_INSENSITIVE) { my f_setSensitive (false); } #elif mac my d_widget = _Gui_initializeWidget (xmToggleButtonWidgetClass, parent -> d_widget, buttonText); _GuiObject_setUserData (my d_widget, me); my d_widget -> isRadioButton = false; CreateCheckBoxControl (my d_widget -> macWindow, & my d_widget -> rect, NULL, (flags & GuiCheckButton_SET) != 0, true, & my d_widget -> nat.control.handle); Melder_assert (my d_widget -> nat.control.handle != NULL); SetControlReference (my d_widget -> nat.control.handle, (long) my d_widget); my d_widget -> isControl = true; _GuiNativeControl_setFont (my d_widget, 0, 13); _GuiNativeControl_setTitle (my d_widget); my v_positionInForm (my d_widget, left, right, top, bottom, parent); if (flags & GuiCheckButton_INSENSITIVE) { my f_setSensitive (false); } #endif return me; }
/* * LookInitDialog: Handle WM_INITDIALOG messages. */ BOOL LookInitDialog(HWND hDlg, HWND hwndFocus, LPARAM lParam) { DWORD style; int numItems, index; info = (LookDialogStruct *) lParam; CenterWindow(hDlg, GetParent(hDlg)); info->hwndListBox = GetDlgItem(hDlg, IDC_ITEMLIST); info->hwndFind = GetDlgItem(hDlg, IDC_ITEMFIND); info->hwndQuanList = GetDlgItem(hDlg, IDC_QUANLIST); // Make list sorted if desired if (info->flags & LD_SORT) { style = GetWindowLong(info->hwndListBox, GWL_STYLE); SetWindowLong(info->hwndListBox, GWL_STYLE, style | LBS_SORT); } if (!(info->flags & LD_AMOUNTS)) { ShowWindow(GetDlgItem(hDlg, IDC_STATIC1), SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDC_QUANLIST), SW_HIDE); } // Draw objects in owner-drawn list box SetWindowLong(info->hwndListBox, GWL_USERDATA, OD_DRAWOBJ); SetWindowText(hDlg, info->title); /* Set window's title */ // Remember state of list box items info->selected = (Bool *) SafeMalloc(list_length(info->contents) * sizeof(Bool)); memset(info->selected, 0, list_length(info->contents) * sizeof(Bool)); LookListSetContents(info->hwndListBox, info->contents, info->flags); numItems = ListBox_GetCount(info->hwndListBox); for(index=0; index < numItems; index++) { ListBox_AddString(info->hwndQuanList," "); ListBox_SetItemData(info->hwndQuanList, index, 0); } Edit_LimitText(info->hwndFind, MAXNAME); SetWindowFont(info->hwndFind, GetFont(FONT_EDIT), TRUE); hwndLookDialog = hDlg; /* Subclass main list box */ info->lpfnDefLookProc = SubclassWindow(info->hwndListBox, LookProc); return TRUE; }
/*! ポッパップの文字サイズ変更と表示非表示が入った @param[in] ttSize 文字サイズ・12か16しかない @param[in] bView 非0表示 0表示しない @return HRESULT 終了状態コード */ HRESULT AaItemsTipSizeChange( INT ttSize, UINT bView ) { #ifdef MAA_TOOLTIP LOGFONT stFont; #endif gbAAtipView = bView ? TRUE : FALSE; #ifdef MAA_TOOLTIP SetWindowFont( ghToolTipWnd, GetStockFont(DEFAULT_GUI_FONT), FALSE ); DeleteFont( ghTipFont ); // 今使ってるヤツぶっ壊してから、新しいのつくってくっつける ViewingFontGet( &stFont ); // gstBaseFont stFont.lfHeight = (FONTSZ_REDUCE == ttSize) ? FONTSZ_REDUCE : FONTSZ_NORMAL; ghTipFont = CreateFontIndirect( &stFont ); SetWindowFont( ghToolTipWnd, ghTipFont, TRUE ); #endif return S_OK; }
/** * @brief WM_INITDIALOG handler of Machine Info dialog. * @param hwnd - window handle. * @param hwndFocus - system-defined focus window. * @param lParam - user-defined parameter. * @return true to setup focus to system-defined control. */ static BOOL MachineInfoDlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) { lParam; hwndFocus; if (g_pResManager->m_hBigAppIcon) SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)g_pResManager->m_hBigAppIcon); if (g_pResManager->m_hSmallAppIcon) SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)g_pResManager->m_hSmallAppIcon); CenterWindow(hwnd, GetParent(hwnd)); HWND hwndCtl; TCHAR szTempBuf[256]; CStrStream Stream(8 * 1024); hwndCtl = GetDlgItem(hwnd, IDC_CPU_TEXT); if (g_pResManager->m_hFixedFont) SetWindowFont(hwndCtl, g_pResManager->m_hFixedFont, FALSE); Stream.Reset(); CSymEngine::GetCpuString(Stream); SetWindowText(hwndCtl, Stream); hwndCtl = GetDlgItem(hwnd, IDC_OS_TEXT); if (g_pResManager->m_hFixedFont) SetWindowFont(hwndCtl, g_pResManager->m_hFixedFont, FALSE); CSymEngine::GetOsString(szTempBuf, countof(szTempBuf)); SetWindowText(hwndCtl, szTempBuf); hwndCtl = GetDlgItem(hwnd, IDC_MEM_TEXT); if (g_pResManager->m_hFixedFont) SetWindowFont(hwndCtl, g_pResManager->m_hFixedFont, FALSE); CSymEngine::GetMemString(szTempBuf, countof(szTempBuf)); SetWindowText(hwndCtl, szTempBuf); hwndCtl = GetDlgItem(hwnd, IDC_ENVIRONMENT); if (g_pResManager->m_hFixedFont) SetWindowFont(hwndCtl, g_pResManager->m_hFixedFont, FALSE); Stream.Reset(); CSymEngine::GetEnvironmentStrings(Stream); SetWindowText(hwndCtl, Stream); return TRUE; }
/* * GroupDialogProc: Dialog procedure for group dialog. */ BOOL CALLBACK GroupDialogProc(HWND hDlg, UINT message, UINT wParam, LONG lParam) { int i, index; HWND hList, hCombo; list_type l; switch (message) { case WM_INITDIALOG: // Add groups to list box hCombo = GetDlgItem(hDlg, IDC_GROUPS); SetWindowFont(hCombo, GetFont(FONT_LIST), FALSE); for (i=0; i < num_groups; i++) index = ComboBox_AddString(hCombo, groups[i]); // Add logged on users to list box hList = GetDlgItem(hDlg, IDC_LOGGEDON); SetWindowFont(hList, GetFont(FONT_LIST), FALSE); for (l = *(cinfo->current_users); l != NULL; l = l->next) { object_node *obj = (object_node *) (l->data); ListBox_AddString(hList, LookupNameRsc(obj->name_res)); } PostMessage(hDlg, BK_CREATED, 0, 0); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPMEMBERS), GetFont(FONT_LIST), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_ADDNAME), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_NEWGROUP), GetFont(FONT_EDIT), FALSE); SetWindowFont(GetDlgItem(hDlg, IDC_GROUPTELL), GetFont(FONT_EDIT), FALSE); Edit_LimitText(GetDlgItem(hDlg, IDC_NEWGROUP), MAX_GROUPNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_ADDNAME), MAX_CHARNAME); Edit_LimitText(GetDlgItem(hDlg, IDC_GROUPTELL), MAXSAY); if (num_groups >= MAX_NUMGROUPS) EnableWindow(GetDlgItem(hDlg, IDC_NEWGROUP), FALSE); hGroupDialog = hDlg; CenterWindow(hDlg, GetParent(hDlg)); return TRUE; case BK_CREATED: hCombo = GetDlgItem(hDlg, IDC_GROUPS); ComboBox_SetCurSel(hCombo, 0); // Need this for some reason to simulate WM_COMMAND GroupCommand(hDlg, IDC_GROUPS, hCombo, CBN_SELCHANGE); return TRUE; HANDLE_MSG(hDlg, WM_COMMAND, GroupCommand); case WM_DRAWITEM: // windowsx.h macro always returns FALSE return GroupListDrawItem(hDlg, (const DRAWITEMSTRUCT *)(lParam)); case WM_DESTROY: hGroupDialog = NULL; return TRUE; } return FALSE; }
/* This function handles the WM_INITDIALOG message. */ BOOL FASTCALL CmdSignatureDlg_OnInitDialog( HWND hwnd, HWND hwndFocus, LPARAM lParam ) { FINDDATA ft; HWND hwndList; HWND hwndEdit; register int n; LPSTR pDefSig; HFIND r; /* Get the default signature. */ pDefSig = (LPSTR)lParam; /* Fill the list box with all available signatures. */ hwndList = GetDlgItem( hwnd, IDD_LIST ); for( n = r = AmFindFirst( "*.sig", DSD_SIG, _A_NORMAL, &ft ); n != -1; n = Amuser_FindNext( r, &ft ) ) { register int c; for( c = 0; ft.name[ c ] && ft.name[ c ] != '.'; ++c ); ft.name[ c ] = '\0'; ComboBox_AddString( hwndList, ft.name ); } /* Select either the default signature or the first. */ if( ComboBox_GetCount( hwndList ) ) { int index; /* Show the default signature. */ index = 0; if( *pDefSig ) if( CB_ERR == ( index = ComboBox_FindStringExact( hwndList, -1, pDefSig ) ) ) index = 0; ComboBox_SetCurSel( hwndList, index ); CmdSignatureDlg_DisplaySig( hwnd, index ); } else { EnableControl( hwnd, IDD_DELETE, FALSE ); EnableControl( hwnd, IDOK, FALSE ); } Amuser_FindClose( r ); /* Set the font. */ hwndEdit = GetDlgItem( hwnd, IDD_EDIT ); SetWindowFont( hwndEdit, hEditFont, FALSE ); return( TRUE ); }
void ApplicationListDlg::InitDialog() { LVCOLUMN column; //Create the image list //Note: no need to destroy this list, as it will be destroyed automatically //when the list it is associated with is destroyed. m_hImgList = ImageList_Create(16, 16, ILC_COLOR32|ILC_MASK, 10, 5); m_defaultIconIdx = ImageList_AddIcon(m_hImgList, (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_DEFAPP_SMALL), IMAGE_ICON, 16, 16, LR_SHARED)); //Setup the program list m_hAppListWnd = GetDlgItem(m_hDlg, IDC_APPL_LIST); ListView_SetExtendedListViewStyleEx(m_hAppListWnd, LVS_EX_FULLROWSELECT, LVS_EX_FULLROWSELECT); ListView_SetImageList(m_hAppListWnd, m_hImgList, LVSIL_SMALL); column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; column.fmt = LVCFMT_LEFT|LVCFMT_IMAGE; column.cx = m_values ? 250 : 320; locGetString(column.pszText, IDS_PROGRAM); column.iSubItem = -1; ListView_InsertColumn(m_hAppListWnd, 0, &column); if (m_valTitle) { column.fmt = LVCFMT_LEFT; column.cx = 70; column.pszText = (LPTSTR)m_valTitle; column.iSubItem = 0; ListView_InsertColumn(m_hAppListWnd, 1, &column); if (m_values) { m_hParamEditCtrl = CreateWindow("COMBOBOX", "", WS_BORDER|WS_CHILD|CBS_DROPDOWNLIST, 0, 0, 10, 10, m_hAppListWnd, NULL, GetModuleHandle(NULL), 0); const LPCTSTR * val = m_values; while(*val) ComboBox_AddString(m_hParamEditCtrl, *val++); } else m_hParamEditCtrl = CreateWindow("EDIT", "", WS_BORDER|WS_CHILD|ES_NUMBER|ES_AUTOHSCROLL, 0, 0, 0, 0, m_hAppListWnd, NULL, GetModuleHandle(NULL), 0); SetWindowFont(m_hParamEditCtrl, GetWindowFont(m_hDlg), FALSE); } //Populate program list int i; TCHAR filename[MAX_PATH]; DWORD length = MAX_PATH; for(i=0; length=MAX_PATH, m_appgroup->EnumEntry(i, filename, &length); i++) InsertProgram(filename, m_appgroup->LoadDWord(filename, m_defaultValue)); }
/* * ChessDlgShowMover: Show whose turn it is in dialog. */ void ChessDlgShowMover(void) { int id1, id2; // Show whose turn it is if (b.move_color == WHITE) { SetDlgItemText(hChessDlg, IDC_WHITELABEL, GetString(hInst, IDS_WHITEMOVE)); SetDlgItemText(hChessDlg, IDC_BLACKLABEL, GetString(hInst, IDS_BLACK)); id1 = IDC_WHITENAME; id2 = IDC_BLACKNAME; } else { SetDlgItemText(hChessDlg, IDC_WHITELABEL, GetString(hInst, IDS_WHITE)); SetDlgItemText(hChessDlg, IDC_BLACKLABEL, GetString(hInst, IDS_BLACKMOVE)); id1 = IDC_BLACKNAME; id2 = IDC_WHITENAME; } SetWindowFont(GetDlgItem(hChessDlg, id1), GetFont(FONT_TITLES), TRUE); SetWindowFont(GetDlgItem(hChessDlg, id2), GetFont(FONT_STATS), TRUE); }