GME  13
AnnotationPanel.cpp
Go to the documentation of this file.
00001 // AnnotationPanel.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "mgautil.h"
00006 #include "AnnotationPanel.h"
00007 #include "resource.h"
00008 
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014 
00016 // CAnnotationPanel
00017 
00018 CAnnotationPanel::CAnnotationPanel()
00019 {
00020 }
00021 
00022 CAnnotationPanel::~CAnnotationPanel()
00023 {
00024 }
00025 
00026 
00027 BEGIN_MESSAGE_MAP(CAnnotationPanel, CButton)
00028         //{{AFX_MSG_MAP(CAnnotationPanel)
00029         ON_WM_SIZE()
00030         //}}AFX_MSG_MAP
00031 END_MESSAGE_MAP()
00032 
00034 // CAnnotationPanel message handlers
00035 
00036 void CAnnotationPanel::OnSize(UINT nType, int cx, int cy) 
00037 {
00038         CButton::OnSize(nType, cx, cy);
00039         
00040         CDialog *prnt = (CDialog*)(GetParent());
00041 
00042         CWnd *ctrl;
00043 
00044         // Labels 
00045         ctrl = prnt->GetDlgItem(IDC_STATIC_NAME);
00046         if (ctrl->GetSafeHwnd()) {
00047                 CRect origRect(13,14,13+22,14+8);
00048                 prnt->MapDialogRect(&origRect);
00049                 ClientToScreen(&origRect);
00050                 prnt->ScreenToClient(&origRect);
00051                 ctrl->MoveWindow(&origRect);
00052         }
00053 
00054         ctrl = prnt->GetDlgItem(IDC_STATIC_TEXT);
00055         if (ctrl->GetSafeHwnd()) {
00056                 CRect origRect(13,30,13+17,30+8);
00057                 prnt->MapDialogRect(&origRect);
00058                 ClientToScreen(&origRect);
00059                 prnt->ScreenToClient(&origRect);
00060                 ctrl->MoveWindow(&origRect);
00061         }
00062 
00063         ctrl = prnt->GetDlgItem(IDC_STATIC_COLOR);
00064         if (ctrl->GetSafeHwnd()) {
00065                 CRect origRect(13,97+16,13+45,97+8+16);
00066                 prnt->MapDialogRect(&origRect);
00067                 ClientToScreen(&origRect);
00068                 prnt->ScreenToClient(&origRect);
00069                 ctrl->MoveWindow(&origRect);
00070         }
00071 
00072         ctrl = prnt->GetDlgItem(IDC_STATIC_BGCOLOR);
00073         if (ctrl->GetSafeHwnd()) {
00074                 CRect origRect(13,113+16,13+45,113+8+16);
00075                 prnt->MapDialogRect(&origRect);
00076                 ClientToScreen(&origRect);
00077                 prnt->ScreenToClient(&origRect);
00078                 ctrl->MoveWindow(&origRect);
00079         }
00080 
00081         ctrl = prnt->GetDlgItem(IDC_STATIC_SHADOWCOLOR);
00082         if (ctrl->GetSafeHwnd()) {
00083                 CRect origRect(13,129+16,13+45,129+8+16);
00084                 prnt->MapDialogRect(&origRect);
00085                 ClientToScreen(&origRect);
00086                 prnt->ScreenToClient(&origRect);
00087                 ctrl->MoveWindow(&origRect);
00088         }
00089 
00090         ctrl = prnt->GetDlgItem(IDC_STATIC_GRADIENTCOLOR);
00091         if (ctrl->GetSafeHwnd()) {
00092                 CRect origRect(13,145+16,13+45,145+8+16);
00093                 prnt->MapDialogRect(&origRect);
00094                 ClientToScreen(&origRect);
00095                 prnt->ScreenToClient(&origRect);
00096                 ctrl->MoveWindow(&origRect);
00097         }
00098 
00099         ctrl = prnt->GetDlgItem(IDC_STATIC_GRADIENTDIR);
00100         if (ctrl->GetSafeHwnd()) {
00101                 CRect origRect(75,162+16,75+51,162+8+16);
00102                 prnt->MapDialogRect(&origRect);
00103                 ClientToScreen(&origRect);
00104                 prnt->ScreenToClient(&origRect);
00105                 ctrl->MoveWindow(&origRect);
00106         }
00107 
00108         ctrl = prnt->GetDlgItem(IDC_STATIC_SHADOWDEPTH);
00109         if (ctrl->GetSafeHwnd()) {
00110                 CRect origRect(75,178+16,75+51,178+8+16);
00111                 prnt->MapDialogRect(&origRect);
00112                 ClientToScreen(&origRect);
00113                 prnt->ScreenToClient(&origRect);
00114                 ctrl->MoveWindow(&origRect);
00115         }
00116 
00117         ctrl = prnt->GetDlgItem(IDC_STATIC_SHADOWDIRECTION);
00118         if (ctrl->GetSafeHwnd()) {
00119                 CRect origRect(75,194+16,75+51,194+8+16);
00120                 prnt->MapDialogRect(&origRect);
00121                 ClientToScreen(&origRect);
00122                 prnt->ScreenToClient(&origRect);
00123                 ctrl->MoveWindow(&origRect);
00124         }
00125 
00126         ctrl = prnt->GetDlgItem(IDC_STATIC_FONT);
00127         if (ctrl->GetSafeHwnd()) {
00128                 CRect origRect(13,226+16,13+17,226+8+16);
00129                 prnt->MapDialogRect(&origRect);
00130                 ClientToScreen(&origRect);
00131                 prnt->ScreenToClient(&origRect);
00132                 ctrl->MoveWindow(&origRect);
00133         }
00134 
00135         ctrl = prnt->GetDlgItem(IDC_STATIC_CORNERRADIUS);
00136         if (ctrl->GetSafeHwnd()) {
00137                 CRect origRect(75,210+16,75+17,210+8+16);
00138                 prnt->MapDialogRect(&origRect);
00139                 ClientToScreen(&origRect);
00140                 prnt->ScreenToClient(&origRect);
00141                 ctrl->MoveWindow(&origRect);
00142         }
00143 
00144         // Edit Fields
00145         ctrl = prnt->GetDlgItem(IDC_EDIT_NAME);
00146         if (ctrl->GetSafeHwnd()) {
00147                 CRect origRect(38,11,38+155,11+14);
00148                 CRect origRect2(192,11,200,11+14);
00149                 prnt->MapDialogRect(&origRect);
00150                 prnt->MapDialogRect(&origRect2);
00151                 origRect.right = cx - (origRect2.right - origRect2.left);
00152                 ClientToScreen(&origRect);
00153                 prnt->ScreenToClient(&origRect);
00154                 ctrl->MoveWindow(&origRect);
00155         }
00156         
00157         ctrl = prnt->GetDlgItem(IDC_EDIT_TEXT);
00158         if (ctrl->GetSafeHwnd()) {
00159                 CRect origRect(38,30,38+155,30+60);
00160                 CRect origRect2(192,30,200,30+60);
00161                 prnt->MapDialogRect(&origRect);
00162                 prnt->MapDialogRect(&origRect2);
00163                 origRect.right = cx - (origRect2.right - origRect2.left);
00164                 ClientToScreen(&origRect);
00165                 prnt->ScreenToClient(&origRect);
00166                 ctrl->MoveWindow(&origRect);
00167         }
00168 
00169         ctrl = prnt->GetDlgItem(IDC_EDIT_GRADIENTDIR);
00170         if (ctrl->GetSafeHwnd()) {
00171                 CRect origRect(135,158+16,135+55,158+14+16);
00172                 prnt->MapDialogRect(&origRect);
00173                 ClientToScreen(&origRect);
00174                 prnt->ScreenToClient(&origRect);
00175                 ctrl->MoveWindow(&origRect);
00176         }
00177 
00178         ctrl = prnt->GetDlgItem(IDC_EDIT_SHADOWDEPTH);
00179         if (ctrl->GetSafeHwnd()) {
00180                 CRect origRect(135,174+16,135+55,174+14+16);
00181                 prnt->MapDialogRect(&origRect);
00182                 ClientToScreen(&origRect);
00183                 prnt->ScreenToClient(&origRect);
00184                 ctrl->MoveWindow(&origRect);
00185         }
00186 
00187         ctrl = prnt->GetDlgItem(IDC_EDIT_SHADOWDIRECTION);
00188         if (ctrl->GetSafeHwnd()) {
00189                 CRect origRect(135,190+16,135+55,190+14+16);
00190                 prnt->MapDialogRect(&origRect);
00191                 ClientToScreen(&origRect);
00192                 prnt->ScreenToClient(&origRect);
00193                 ctrl->MoveWindow(&origRect);
00194         }
00195 
00196         ctrl = prnt->GetDlgItem(IDC_EDIT_CORNERRADIUS);
00197         if (ctrl->GetSafeHwnd()) {
00198                 CRect origRect(135,206+16,135+55,206+14+16);
00199                 prnt->MapDialogRect(&origRect);
00200                 ClientToScreen(&origRect);
00201                 prnt->ScreenToClient(&origRect);
00202                 ctrl->MoveWindow(&origRect);
00203         }
00204 
00205         // inheritable checkbox
00206         ctrl = prnt->GetDlgItem(IDC_CHECK1);
00207         if (ctrl->GetSafeHwnd()) {
00208                 CRect origRect(13,94,13+55,94+14);
00209                 //CRect origRect2(192,94,200,94+14);
00210                 prnt->MapDialogRect(&origRect);
00211                 //prnt->MapDialogRect(&origRect2);
00212                 //origRect.right = cx - (origRect2.right - origRect2.left);
00213                 ClientToScreen(&origRect);
00214                 prnt->ScreenToClient(&origRect);
00215                 ctrl->MoveWindow(&origRect);
00216         }
00217 
00218         // reDerive 
00219         ctrl = prnt->GetDlgItem(IDC_REDERIVEBUTTON);
00220         if (ctrl->GetSafeHwnd()) {
00221                 CRect origRect(13+55+10,94,13+55+10+54,94+14);
00222                 //CRect origRect2(192,94,200,94+14);
00223                 prnt->MapDialogRect(&origRect);
00224                 //prnt->MapDialogRect(&origRect2);
00225                 //origRect.right = cx - (origRect2.right - origRect2.left);
00226                 ClientToScreen(&origRect);
00227                 prnt->ScreenToClient(&origRect);
00228                 ctrl->MoveWindow(&origRect);
00229         }
00230 
00231         // showHide
00232         ctrl = prnt->GetDlgItem(IDC_SHOWHIDEBUTTON);
00233         if (ctrl->GetSafeHwnd()) {
00234                 CRect origRect(13+55+10+54+10,94,13+55+10+54+10+54,94+14);
00235                 CRect origRect2(192,94,200,94+14);
00236                 prnt->MapDialogRect(&origRect);
00237                 prnt->MapDialogRect(&origRect2);
00238                 origRect.right = cx - (origRect2.right - origRect2.left);
00239                 ClientToScreen(&origRect);
00240                 prnt->ScreenToClient(&origRect);
00241                 ctrl->MoveWindow(&origRect);
00242         }
00243 
00244         ctrl = prnt->GetDlgItem(IDC_COMBO_COLOR);
00245         if (ctrl->GetSafeHwnd()) {
00246                 CRect origRect(58,94+16,38+135,94+14+16);
00247                 CRect origRect2(192,94+16,200,94+14+16);
00248                 prnt->MapDialogRect(&origRect);
00249                 prnt->MapDialogRect(&origRect2);
00250                 origRect.right = cx - (origRect2.right - origRect2.left);
00251                 ClientToScreen(&origRect);
00252                 prnt->ScreenToClient(&origRect);
00253                 ctrl->MoveWindow(&origRect);
00254         }
00255 
00256         ctrl = prnt->GetDlgItem(IDC_COMBO_BGCOLOR);
00257         if (ctrl->GetSafeHwnd()) {
00258                 CRect origRect(58,110+16,38+135,110+14+16);
00259                 CRect origRect2(192,110+16,200,110+14+16);
00260                 prnt->MapDialogRect(&origRect);
00261                 prnt->MapDialogRect(&origRect2);
00262                 origRect.right = cx - (origRect2.right - origRect2.left);
00263                 ClientToScreen(&origRect);
00264                 prnt->ScreenToClient(&origRect);
00265                 ctrl->MoveWindow(&origRect);
00266         }
00267 
00268         ctrl = prnt->GetDlgItem(IDC_COMBO_SHADOWCOLOR);
00269         if (ctrl->GetSafeHwnd()) {
00270                 CRect origRect(58,126+16,38+135,126+14+16);
00271                 CRect origRect2(192,126+16,200,126+14+16);
00272                 prnt->MapDialogRect(&origRect);
00273                 prnt->MapDialogRect(&origRect2);
00274                 origRect.right = cx - (origRect2.right - origRect2.left);
00275                 ClientToScreen(&origRect);
00276                 prnt->ScreenToClient(&origRect);
00277                 ctrl->MoveWindow(&origRect);
00278         }
00279 
00280         ctrl = prnt->GetDlgItem(IDC_COMBO_GRADIENTCOLOR);
00281         if (ctrl->GetSafeHwnd()) {
00282                 CRect origRect(58,142+16,38+135,142+14+16);
00283                 CRect origRect2(192,142+16,200,142+14+16);
00284                 prnt->MapDialogRect(&origRect);
00285                 prnt->MapDialogRect(&origRect2);
00286                 origRect.right = cx - (origRect2.right - origRect2.left);
00287                 ClientToScreen(&origRect);
00288                 prnt->ScreenToClient(&origRect);
00289                 ctrl->MoveWindow(&origRect);
00290         }
00291 
00292         ctrl = prnt->GetDlgItem(IDC_CHECK_GRADIENTFILL);
00293         if (ctrl->GetSafeHwnd()) {
00294                 CRect origRect(13,162+16,13+55,162+10+16);
00295                 prnt->MapDialogRect(&origRect);
00296                 ClientToScreen(&origRect);
00297                 prnt->ScreenToClient(&origRect);
00298                 ctrl->MoveWindow(&origRect);
00299         }
00300 
00301         ctrl = prnt->GetDlgItem(IDC_CHECK_CASTSHADOW);
00302         if (ctrl->GetSafeHwnd()) {
00303                 CRect origRect(13,177+16,13+55,177+10+16);
00304                 prnt->MapDialogRect(&origRect);
00305                 ClientToScreen(&origRect);
00306                 prnt->ScreenToClient(&origRect);
00307                 ctrl->MoveWindow(&origRect);
00308         }
00309 
00310         ctrl = prnt->GetDlgItem(IDC_CHECK_ROUNDCORNER);
00311         if (ctrl->GetSafeHwnd()) {
00312                 CRect origRect(13,209+16,13+55,209+10+16);
00313                 prnt->MapDialogRect(&origRect);
00314                 ClientToScreen(&origRect);
00315                 prnt->ScreenToClient(&origRect);
00316                 ctrl->MoveWindow(&origRect);
00317         }
00318 
00319         ctrl = prnt->GetDlgItem(IDC_EDIT_FONT);
00320         if (ctrl->GetSafeHwnd()) {
00321                 CRect origRect(58,223+16,58+115,223+14+16);
00322                 CRect origRect2(167,223+16,200,223+14+16);
00323                 prnt->MapDialogRect(&origRect);
00324                 prnt->MapDialogRect(&origRect2);
00325                 origRect.right = cx - (origRect2.right - origRect2.left);
00326                 ClientToScreen(&origRect);
00327                 prnt->ScreenToClient(&origRect);
00328                 ctrl->MoveWindow(&origRect);
00329         }
00330 
00331         ctrl = prnt->GetDlgItem(IDC_BUTTON_FONT);
00332         if (ctrl->GetSafeHwnd()) {
00333                 CRect origRect(173,223+16,173+20,223+14+16);
00334                 CRect origRect2(192,223+16,200,223+14+16);
00335                 prnt->MapDialogRect(&origRect);
00336                 int sx = origRect.right - origRect.left;
00337                 prnt->MapDialogRect(&origRect2);
00338                 origRect.right = cx - (origRect2.right - origRect2.left);
00339                 origRect.left = origRect.right - sx;
00340                 ClientToScreen(&origRect);
00341                 prnt->ScreenToClient(&origRect);
00342                 ctrl->MoveWindow(&origRect);
00343         }
00344 
00345         ctrl = prnt->GetDlgItem(IDC_STATIC_VISIBILITY);
00346         if (ctrl->GetSafeHwnd()) {
00347                 CRect origRect(3,235+16,3+190,235+70+16);
00348                 CRect origRect2(197,235+16,200,235+70+16);
00349                 CRect origRect3(3,318+16,3+190,318+3+16);
00350                 prnt->MapDialogRect(&origRect);
00351                 prnt->MapDialogRect(&origRect2);
00352                 prnt->MapDialogRect(&origRect3);
00353                 origRect.right = cx - (origRect2.right - origRect2.left);
00354                 origRect.bottom = cy - (origRect3.bottom - origRect3.top);
00355                 ClientToScreen(&origRect);
00356                 prnt->ScreenToClient(&origRect);
00357                 ctrl->MoveWindow(&origRect);
00358         }
00359 
00360         ctrl = prnt->GetDlgItem(IDC_LIST_ASPECT);
00361         if (ctrl->GetSafeHwnd()) {
00362                 CRect origRect(7,244+16,7+120,244+55+16);
00363                 CRect origRect2(130,244+16,200,244+55+16);
00364                 CRect origRect3(7,299+16,7+120,299+7+16);
00365                 prnt->MapDialogRect(&origRect);
00366                 prnt->MapDialogRect(&origRect2);
00367                 prnt->MapDialogRect(&origRect3);
00368                 origRect.right = cx - (origRect2.right - origRect2.left);
00369                 origRect.bottom = cy - (origRect3.bottom - origRect3.top);
00370                 ClientToScreen(&origRect);
00371                 prnt->ScreenToClient(&origRect);
00372                 ctrl->MoveWindow(&origRect);
00373         }
00374 
00375         ctrl = prnt->GetDlgItem(IDC_STATIC_XCOORD);
00376         if (ctrl->GetSafeHwnd()) {
00377                 CRect origRect(141,252+16,141+8,252+8+16);
00378                 CRect origRect2(148,252+16,200,252+8+16);
00379                 prnt->MapDialogRect(&origRect);
00380                 int sx = origRect.right - origRect.left;
00381                 prnt->MapDialogRect(&origRect2);
00382                 origRect.right = cx - (origRect2.right - origRect2.left);
00383                 origRect.left = origRect.right - sx;
00384                 ClientToScreen(&origRect);
00385                 prnt->ScreenToClient(&origRect);
00386                 ctrl->MoveWindow(&origRect);
00387         }
00388 
00389         ctrl = prnt->GetDlgItem(IDC_STATIC_YCOORD);
00390         if (ctrl->GetSafeHwnd()) {
00391                 CRect origRect(141,274+16,141+8,274+8+16);
00392                 CRect origRect2(148,274+16,200,274+8+16);
00393                 prnt->MapDialogRect(&origRect);
00394                 int sx = origRect.right - origRect.left;
00395                 prnt->MapDialogRect(&origRect2);
00396                 origRect.right = cx - (origRect2.right - origRect2.left);
00397                 origRect.left = origRect.right - sx;
00398                 ClientToScreen(&origRect);
00399                 prnt->ScreenToClient(&origRect);
00400                 ctrl->MoveWindow(&origRect);
00401         }
00402 
00403         ctrl = prnt->GetDlgItem(IDC_EDIT_XCOORD);
00404         if (ctrl->GetSafeHwnd()) {
00405                 CRect origRect(151,248+16,151+40,248+14+16);
00406                 CRect origRect2(190,248+16,200,248+14+16);
00407                 prnt->MapDialogRect(&origRect);
00408                 int sx = origRect.right - origRect.left;
00409                 prnt->MapDialogRect(&origRect2);
00410                 origRect.right = cx - (origRect2.right - origRect2.left);
00411                 origRect.left = origRect.right - sx;
00412                 ClientToScreen(&origRect);
00413                 prnt->ScreenToClient(&origRect);
00414                 ctrl->MoveWindow(&origRect);
00415         }
00416 
00417         ctrl = prnt->GetDlgItem(IDC_EDIT_YCOORD);
00418         if (ctrl->GetSafeHwnd()) {
00419                 CRect origRect(151,269+16,151+40,269+14+16);
00420                 CRect origRect2(190,269+16,200,269+14+16);
00421                 prnt->MapDialogRect(&origRect);
00422                 int sx = origRect.right - origRect.left;
00423                 prnt->MapDialogRect(&origRect2);
00424                 origRect.right = cx - (origRect2.right - origRect2.left);
00425                 origRect.left = origRect.right - sx;
00426                 ClientToScreen(&origRect);
00427                 prnt->ScreenToClient(&origRect);
00428                 ctrl->MoveWindow(&origRect);
00429         }
00430 
00431         ctrl = prnt->GetDlgItem(IDC_CHECK_DEFPOS);
00432         if (ctrl->GetSafeHwnd()) {
00433                 CRect origRect(141,289+16,141+53,289+10+16);
00434                 CRect origRect2(193,289+16,200,289+10+16);
00435                 prnt->MapDialogRect(&origRect);
00436                 int sx = origRect.right - origRect.left;
00437                 prnt->MapDialogRect(&origRect2);
00438                 origRect.right = cx - (origRect2.right - origRect2.left);
00439                 origRect.left = origRect.right - sx;
00440                 ClientToScreen(&origRect);
00441                 prnt->ScreenToClient(&origRect);
00442                 ctrl->MoveWindow(&origRect);
00443         }
00444 }
00445