From 7aff1e4cb053394db57c2814d5fe1e6493e0cc75 Mon Sep 17 00:00:00 2001 From: watcherhd Date: Sat, 26 Nov 2011 14:19:43 +0000 Subject: Project folders rename part 2 git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@214 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- Dbx_mmap_SA/dbtool/wizard.cpp | 138 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Dbx_mmap_SA/dbtool/wizard.cpp (limited to 'Dbx_mmap_SA/dbtool/wizard.cpp') diff --git a/Dbx_mmap_SA/dbtool/wizard.cpp b/Dbx_mmap_SA/dbtool/wizard.cpp new file mode 100644 index 0000000..8893b36 --- /dev/null +++ b/Dbx_mmap_SA/dbtool/wizard.cpp @@ -0,0 +1,138 @@ +/* +Miranda Database Tool +Copyright 2000-2011 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "dbtool.h" + +static HFONT hBoldFont=NULL; +static HENHMETAFILE hEmfHeaderLogo=NULL; + +static BOOL CALLBACK MyControlsEnumChildren(HWND hwnd,LPARAM lParam) +{ + DWORD style=GetWindowLongPtr(hwnd,GWL_STYLE); + DWORD exstyle=GetWindowLongPtr(hwnd,GWL_EXSTYLE); + char szClass[64]; + int makeBold=0; + + GetClassNameA(hwnd,szClass,sizeof(szClass)); + if(!strcmp(szClass,"Static")) { + if(((style&SS_TYPEMASK)==SS_LEFT || (style&SS_TYPEMASK)==SS_CENTER || (style&SS_TYPEMASK)==SS_RIGHT) && exstyle&WS_EX_CLIENTEDGE) + makeBold=1; + } + else if(!strcmp(szClass,"Button")) { + if(exstyle&WS_EX_CLIENTEDGE) + makeBold=1; + } + if(makeBold) { + if(hBoldFont==NULL) { + LOGFONT lf; + hBoldFont=(HFONT)SendMessage(hwnd,WM_GETFONT,0,0); + GetObject(hBoldFont,sizeof(lf),&lf); + lf.lfWeight=FW_BOLD; + hBoldFont=CreateFontIndirect(&lf); + } + SendMessage(hwnd,WM_SETFONT,(WPARAM)hBoldFont,0); + SetWindowLongPtr(hwnd,GWL_EXSTYLE,exstyle&~WS_EX_CLIENTEDGE); + SetWindowPos(hwnd,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED); + } + return TRUE; +} + +int DoMyControlProcessing(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam,BOOL *bReturn) +{ + switch(message) { + case WM_INITDIALOG: + EnumChildWindows(hdlg,MyControlsEnumChildren,0); + + break; + case WM_CTLCOLORSTATIC: + if (GetWindowLongPtr((HWND)lParam, GWL_ID) == IDC_HDRLOGO){ + SetBkColor((HDC)wParam,RGB(255,255,255)); + *bReturn=(BOOL)GetStockObject(WHITE_BRUSH); + return TRUE; + } + if((GetWindowLongPtr((HWND)lParam,GWL_STYLE)&0xFFFF)==0) { + char szText[256]; + GetWindowTextA((HWND)lParam,szText,sizeof(szText)); + if(!strcmp(szText,"whiterect")) { + SetTextColor((HDC)wParam,RGB(255,255,255)); + SetBkColor((HDC)wParam,RGB(255,255,255)); + SetBkMode((HDC)wParam,OPAQUE); + *bReturn=(BOOL)GetStockObject(WHITE_BRUSH); + return TRUE; + } + else { + SetBkMode((HDC)wParam,TRANSPARENT); + *bReturn=(BOOL)GetStockObject(NULL_BRUSH); + return TRUE; + } + } + break; + } + return FALSE; +} + +INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam) +{ + static HWND hdlgPage; + + switch(message) { + case WM_INITDIALOG: + SendMessage(hdlg,WM_SETICON,ICON_SMALL,(LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_DBTOOL))); + hdlgPage=NULL; + SendMessage(hdlg,WZM_GOTOPAGE,IDD_WELCOME,(LPARAM)WelcomeDlgProc); + TranslateDialog(hdlg); + return TRUE; + case WZM_GOTOPAGE: + if(hdlgPage!=NULL) DestroyWindow(hdlgPage); + EnableWindow(GetDlgItem(hdlg,IDC_BACK),TRUE); + EnableWindow(GetDlgItem(hdlg,IDOK),TRUE); + EnableWindow(GetDlgItem(hdlg,IDCANCEL),TRUE); + SetDlgItemText(hdlg,IDCANCEL,TranslateT("Cancel")); + hdlgPage=CreateDialog(hInst,MAKEINTRESOURCE(wParam),hdlg,(DLGPROC)lParam); + TranslateDialog(hdlgPage); + SetWindowPos(hdlgPage,0,0,0,0,0,SWP_NOZORDER|SWP_NOSIZE); + ShowWindow(hdlgPage,SW_SHOW); + break; + case WM_COMMAND: + switch(LOWORD(wParam)) { + case IDC_BACK: + case IDOK: + SendMessage(hdlgPage,WZN_PAGECHANGING,wParam,0); + SendMessage(hdlgPage,message,wParam,lParam); + break; + case IDCANCEL: + if(SendMessage(hdlgPage,WZN_CANCELCLICKED,0,0)) break; + EndDialog(hdlg,0); + break; + } + break; + case WM_DESTROY: + if (opts.hFile) + CloseHandle(opts.hFile); + if (opts.hOutFile) + CloseHandle(opts.hOutFile); + DestroyWindow(hdlgPage); + UnloadLangPackModule(); + if(hBoldFont!=NULL) DeleteObject(hBoldFont); + if(hEmfHeaderLogo!=NULL) DeleteEnhMetaFile(hEmfHeaderLogo); + break; + } + return FALSE; +} -- cgit v1.2.3