summaryrefslogtreecommitdiff
path: root/src/modules/utils/resizer.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-06 13:58:20 +0000
commit46a53191c1ad11a41c948594e972568e62d155b4 (patch)
tree7e57e6f7093fb0de766fe13a933d2f9231433e4d /src/modules/utils/resizer.cpp
parent1fe5acae909ea64a1de9ac9f58cae5a3c2d3ad1f (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils/resizer.cpp')
-rw-r--r--src/modules/utils/resizer.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp
index 31806f644e..17358aadfb 100644
--- a/src/modules/utils/resizer.cpp
+++ b/src/modules/utils/resizer.cpp
@@ -61,26 +61,26 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
int procResult;
int extendedDlg,itemCount;
- if(urd==NULL||urd->cbSize!=sizeof(UTILRESIZEDIALOG)) return 1;
+ if (urd==NULL||urd->cbSize!=sizeof(UTILRESIZEDIALOG)) return 1;
pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance,FindResourceA(urd->hInstance,urd->lpTemplate,MAKEINTRESOURCEA(5))));
pTemplateEx=(START_OF_DLGTEMPLATEEX*)pTemplate;
extendedDlg=pTemplateEx->signature==0xFFFF;
- if(extendedDlg && pTemplateEx->dlgVer!=1)
+ if (extendedDlg && pTemplateEx->dlgVer!=1)
return 1;
- if(extendedDlg) pWord=(PWORD)(pTemplateEx+1);
+ if (extendedDlg) pWord=(PWORD)(pTemplateEx+1);
else pWord=(PWORD)(pTemplate+1);
- if(*pWord==0xFFFF) pWord+=2; else while(*pWord++); //menu
- if(*pWord==0xFFFF) pWord+=2; else while(*pWord++); //class
+ if (*pWord==0xFFFF) pWord+=2; else while(*pWord++); //menu
+ if (*pWord==0xFFFF) pWord+=2; else while(*pWord++); //class
while(*pWord++); //title
- if(extendedDlg) {
- if(pTemplateEx->style&DS_SETFONT) {
+ if (extendedDlg) {
+ if (pTemplateEx->style&DS_SETFONT) {
pWord+=3; //font size,weight,italic
while(*pWord++); //font name
}
}
else {
- if(pTemplate->style&DS_SETFONT) {
+ if (pTemplate->style&DS_SETFONT) {
pWord++; //font size
while(*pWord++); //font name
}
@@ -88,20 +88,20 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
urc.cbSize=sizeof(UTILRESIZECONTROL);
rc.left=0; rc.top=0;
- if(extendedDlg) {rc.right=pTemplateEx->cx; rc.bottom=pTemplateEx->cy;}
+ if (extendedDlg) {rc.right=pTemplateEx->cx; rc.bottom=pTemplateEx->cy;}
else {rc.right=pTemplate->cx; rc.bottom=pTemplate->cy;}
MapDialogRect(urd->hwndDlg,&rc);
urc.dlgOriginalSize.cx=rc.right; urc.dlgOriginalSize.cy=rc.bottom;
GetClientRect(urd->hwndDlg,&rc);
urc.dlgNewSize.cx=rc.right; urc.dlgNewSize.cy=rc.bottom;
- if(extendedDlg) itemCount=pTemplateEx->cDlgItems;
+ if (extendedDlg) itemCount=pTemplateEx->cDlgItems;
else itemCount=pTemplate->cdit;
hDwp=BeginDeferWindowPos(itemCount);
- for(i=0;i<itemCount;i++) {
- if((UINT_PTR)pWord&2) pWord++; //dword align
+ for (i=0;i<itemCount;i++) {
+ if ((UINT_PTR)pWord&2) pWord++; //dword align
- if(extendedDlg) {
+ if (extendedDlg) {
pItemEx=(START_OF_DLGITEMTEMPLATEEX*)pWord;
pWord=(PWORD)(pItemEx+1);
@@ -117,31 +117,31 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam)
urc.rcItem.left=pItem->x; urc.rcItem.top=pItem->y;
urc.rcItem.right=urc.rcItem.left+pItem->cx; urc.rcItem.bottom=urc.rcItem.top+pItem->cy;
}
- if(*pWord==0xFFFF) pWord+=2; else while(*pWord++); //menu
- if(*pWord==0xFFFF) pWord+=2; else while(*pWord++); //class
+ if (*pWord==0xFFFF) pWord+=2; else while(*pWord++); //menu
+ if (*pWord==0xFFFF) pWord+=2; else while(*pWord++); //class
pWord+=1+(1+*pWord)/2; //creation data
- if(urc.wId==65535) continue; //using this breaks the dwp, so just ignore it
+ if (urc.wId==65535) continue; //using this breaks the dwp, so just ignore it
MapDialogRect(urd->hwndDlg,&urc.rcItem);
procResult=(urd->pfnResizer)(urd->hwndDlg,urd->lParam,&urc);
- if(procResult&RD_ANCHORX_RIGHT) {
+ if (procResult&RD_ANCHORX_RIGHT) {
urc.rcItem.left+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
urc.rcItem.right+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
}
- else if(procResult&RD_ANCHORX_WIDTH)
+ else if (procResult&RD_ANCHORX_WIDTH)
urc.rcItem.right+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx;
- else if(procResult&RD_ANCHORX_CENTRE) {
+ else if (procResult&RD_ANCHORX_CENTRE) {
urc.rcItem.left+=(urc.dlgNewSize.cx-urc.dlgOriginalSize.cx)/2;
urc.rcItem.right+=(urc.dlgNewSize.cx-urc.dlgOriginalSize.cx)/2;
}
- if(procResult&RD_ANCHORY_BOTTOM) {
+ if (procResult&RD_ANCHORY_BOTTOM) {
urc.rcItem.top+=urc.dlgNewSize.cy-urc.dlgOriginalSize.cy;
urc.rcItem.bottom+=urc.dlgNewSize.cy-urc.dlgOriginalSize.cy;
}
- else if(procResult&RD_ANCHORY_HEIGHT)
+ else if (procResult&RD_ANCHORY_HEIGHT)
urc.rcItem.bottom+=urc.dlgNewSize.cy-urc.dlgOriginalSize.cy;
- else if(procResult&RD_ANCHORY_CENTRE) {
+ else if (procResult&RD_ANCHORY_CENTRE) {
urc.rcItem.top+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
urc.rcItem.bottom+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2;
}