-
Notifications
You must be signed in to change notification settings - Fork 2
/
CubeMiniDB.cpp
103 lines (82 loc) · 3 KB
/
CubeMiniDB.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//-----------------------------------------------------------------------------
// File: CubeMiniDB.cpp
//
// Desc:
//
// Copyright (c) 2002 Dan
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Includes
#include <windows.h>
#include <commctrl.h>
#include "PolygonManager.h"
#include "CustomMsg.h"
#include "main.h"
#include "resource.h"
#include "MessageProcs.h"
#include "CubeMiniDB.h"
#include "Settings.h"
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Name: OnCubeMini_WMInitDialog()
// Desc:
//-----------------------------------------------------------------------------
void OnCubeMini_WMInitDialog( HWND hWnd )
{
ShowWindow( hWnd, true );
UpdateWindow( hWnd );
PolygonManager->NewBrush( CUBEBRUSH );
char str[256];
sprintf( str, "%f", Settings->m_fBrush_Cube_Depth );
SetDlgItemTextA( hWnd, IDC_EDIT_CUBE_DEPTH, str );
sprintf( str, "%f", Settings->m_fBrush_Cube_Width );
SetDlgItemTextA( hWnd, IDC_EDIT_CUBE_WIDTH, str );
sprintf( str, "%f", Settings->m_fBrush_Cube_Height );
SetDlgItemTextA( hWnd, IDC_EDIT_CUBE_HEIGHT, str );
}
//-----------------------------------------------------------------------------
// Name: OnCubeMini_WMCommand()
// Desc:
//-----------------------------------------------------------------------------
void OnCubeMini_WMCommand( HWND hWnd, WPARAM wParam )
{
}
//-----------------------------------------------------------------------------
// Name: OnCubeMini_WMNotify()
// Desc:
//-----------------------------------------------------------------------------
void OnCubeMini_WMNotify( HWND hWnd, LPARAM lParam )
{
}
//-----------------------------------------------------------------------------
// Name: OnCubeMini_WMDestroy()
// Desc:
//-----------------------------------------------------------------------------
void OnCubeMini_WMDestroy( HWND hWnd )
{
UpdateCubeData( hWnd );
EndDialog( hWnd, 0 );
}
//-----------------------------------------------------------------------------
// Name: UpdateCubeData()
// Desc:
//-----------------------------------------------------------------------------
void UpdateCubeData( HWND hWnd )
{
char str[256];
GetDlgItemTextA( hWnd, IDC_EDIT_CUBE_DEPTH, str, 256 );
Settings->m_fBrush_Cube_Depth = (float)atof( str );
GetDlgItemTextA( hWnd, IDC_EDIT_CUBE_WIDTH, str, 256 );
Settings->m_fBrush_Cube_Width = (float)atof( str );
GetDlgItemTextA( hWnd, IDC_EDIT_CUBE_HEIGHT, str, 256 );
Settings->m_fBrush_Cube_Height = (float)atof( str );
}
//-----------------------------------------------------------------------------
// Name: OnSheetMini_UpdateBrush()
// Desc:
//-----------------------------------------------------------------------------
void OnCubeMini_UpdateBrush( HWND hWnd )
{
UpdateCubeData( hWnd );
PolygonManager->NewBrush( CUBEBRUSH );
}