-
Notifications
You must be signed in to change notification settings - Fork 2
/
CylinderMiniDB.cpp
107 lines (84 loc) · 3.22 KB
/
CylinderMiniDB.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
104
105
106
107
//-----------------------------------------------------------------------------
// File: CylinderMiniDB.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 "settings.h"
#include "CylinderMiniDB.h"
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Name: OnCylinderMini_WMInitDialog()
// Desc:
//-----------------------------------------------------------------------------
void OnCylinderMini_WMInitDialog( HWND hWnd )
{
ShowWindow( hWnd, true );
UpdateWindow( hWnd );
char str[256];
sprintf( str, "%f", Settings->m_fBrush_Cylinder_Height );
SetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_HEIGHT, str );
sprintf( str, "%f", Settings->m_fBrush_Cylinder_Radius );
SetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_RADIUS, str );
sprintf( str, "%i", Settings->m_iBrush_Cylinder_NumSides );
SetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_SIDES, str );
PolygonManager->NewBrush( CYLINDERBRUSH );
}
//-----------------------------------------------------------------------------
// Name: OnCylinderMini_WMCommand()
// Desc:
//-----------------------------------------------------------------------------
void OnCylinderMini_WMCommand( HWND hWnd, WPARAM wParam )
{
}
//-----------------------------------------------------------------------------
// Name: OnCylinderMini_WMNotify()
// Desc:
//-----------------------------------------------------------------------------
void OnCylinderMini_WMNotify( HWND hWnd, LPARAM lParam )
{
}
//-----------------------------------------------------------------------------
// Name: OnCylinderMini_WMDestroy()
// Desc:
//-----------------------------------------------------------------------------
void OnCylinderMini_WMDestroy( HWND hWnd )
{
UpdateCylinderData( hWnd );
EndDialog( hWnd, 0 );
}
//-----------------------------------------------------------------------------
// Name: UpdateCylinderData()
// Desc:
//-----------------------------------------------------------------------------
void UpdateCylinderData( HWND hWnd )
{
char str[256];
GetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_HEIGHT, str, 256 );
Settings->m_fBrush_Cylinder_Height = (float)atof( str );
GetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_RADIUS, str, 256 );
Settings->m_fBrush_Cylinder_Radius = (float)atof( str );
GetDlgItemTextA( hWnd, IDC_EDIT_CYLINDER_SIDES, str, 256 );
Settings->m_iBrush_Cylinder_NumSides = (int)atof( str );
if( Settings->m_iBrush_Cylinder_NumSides <= 0 )
Settings->m_iBrush_Cylinder_NumSides = 1;
}
//-----------------------------------------------------------------------------
// Name: OnSheetMini_UpdateBrush()
// Desc:
//-----------------------------------------------------------------------------
void OnCylinderMini_UpdateBrush( HWND hWnd )
{
UpdateCylinderData( hWnd );
PolygonManager->NewBrush( CYLINDERBRUSH );
}