Al's Programming Resource Homepage  Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

winfuncs.h File Reference

Go to the source code of this file.

Functions

UINT APIENTRY ColorDialogHook (HWND hdlg, UINT msg, WPARAM, LPARAM)
void GetLightColor ()
BOOL CALLBACK StartProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM)


Function Documentation

UINT APIENTRY ColorDialogHook HWND    hdlg,
UINT    msg,
WPARAM   ,
LPARAM   
 

Definition at line 75 of file winfuncs.cpp.

References DialogInUse, FALSE, and TRUE.

Referenced by GetLightColor().

00076 {
00077     switch (msg)
00078     {
00079         case WM_INITDIALOG:
00080         {
00081             if(DialogInUse == 1)  // Ambient
00082                 SetWindowText(hdlg, "Choose Ambient Color");
00083             if(DialogInUse == 2)  // Diffuse
00084                 SetWindowText(hdlg, "Choose Diffuse Color");
00085             if(DialogInUse == 3)  // Specular
00086                 SetWindowText(hdlg, "Choose Specular Color");
00087             return TRUE;
00088         }
00089 
00090         default:
00091             return FALSE;
00092     }
00093 }

void GetLightColor  
 

Definition at line 95 of file winfuncs.cpp.

References ColorDialogHook(), hWnd, and lightColor.

00096 {
00097     COLORREF colors[16];
00098     COLORREF colorRGB = RGB(lightColor[0]*255, lightColor[1]*255, lightColor[2]*255);
00099     CHOOSECOLOR colorDialog;
00100     memset(&colorDialog,0,sizeof(colorDialog));
00101     memset(colors,255,sizeof(colors));
00102     colorDialog.lStructSize = sizeof(CHOOSECOLOR);
00103     colorDialog.hwndOwner = hWnd;
00104     colorDialog.rgbResult = colorRGB;
00105     colorDialog.lpCustColors = colors;
00106     colorDialog.Flags = CC_FULLOPEN | CC_RGBINIT | CC_ENABLEHOOK;
00107     colorDialog.lpfnHook = (LPCCHOOKPROC)ColorDialogHook;
00108     ChooseColor(&colorDialog);
00109     lightColor[0] = (float)GetRValue(colorDialog.rgbResult)/255;
00110     lightColor[1] = (float)GetGValue(colorDialog.rgbResult)/255;
00111     lightColor[2] = (float)GetBValue(colorDialog.rgbResult)/255;
00112 }

BOOL CALLBACK StartProc HWND    hwnd,
UINT    Message,
WPARAM    wParam,
LPARAM   
 

Definition at line 24 of file winfuncs.cpp.

References AppDirectory, BUFFER_SIZE, FALSE, hWndStartDlg, ofn, SplineFileName, szText, and TRUE.

00025 {
00026     switch(Message)
00027     {
00028         case WM_INITDIALOG:
00029             hWndStartDlg = hwnd;
00030 
00031             SendDlgItemMessage(hwnd, IDC_DLG_TEXT1, EM_SETLIMITTEXT, (WPARAM)BUFFER_SIZE - 1, (LPARAM)0);
00032 
00033             sprintf(SplineFileName, "%s", AppDirectory);
00034             strcat(SplineFileName, "\\default.spn");
00035             SetDlgItemText(hWndStartDlg, IDC_DLG_TEXT1, SplineFileName);
00036         return TRUE;
00037 
00038         case WM_COMMAND:
00039             switch(LOWORD(wParam))
00040             {
00041                 case IDCANCEL:
00042                     EndDialog(hwnd, IDCANCEL);
00043                 return TRUE;
00044 
00045                 case IDOK:
00046                     if (GetDlgItemText(hwnd, IDC_DLG_TEXT1, szText, BUFFER_SIZE))
00047                         sprintf(SplineFileName, "%s", szText);
00048                     else
00049                         return FALSE;
00050                     EndDialog(hwnd, IDOK);
00051                 return TRUE;
00052 
00053                 case IDC_DLG_SETPATH1:
00054                     sprintf(szText, "%s", SplineFileName);
00055                     ZeroMemory(&ofn, sizeof(ofn));
00056                     ofn.lStructSize = sizeof(ofn);
00057                     ofn.hwndOwner = hWndStartDlg;
00058                     ofn.lpstrFilter = "Spline Files (*.spn)\0*.spn\0\0";
00059                     ofn.lpstrFile = szText;
00060                     ofn.nMaxFile = MAX_PATH;
00061                     ofn.lpstrInitialDir = AppDirectory;
00062                     ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
00063                     ofn.lpstrDefExt = "spn";
00064                     if(GetOpenFileName(&ofn))
00065                         SetDlgItemText(hWndStartDlg, IDC_DLG_TEXT1, szText);
00066                     sprintf(SplineFileName, "%s", szText);
00067                 return TRUE;
00068             }
00069         break;
00070     }
00071     return FALSE;
00072 }


Generated on Fri Dec 23 05:20:42 2005 for Potentially Visible Sets by doxygen1.2.15