79
78
HWND temp_hwnd, temp_hwnd2;
81
LOGFONT logfont = {-12,-7,0,0,400,0,0,0,0,0,0,
82
DRAFT_QUALITY,FIXED_PITCH|FF_MODERN,TEXT("")};
80
LOGFONT logfont = { -12, -7, 0, 0, 400, 0, 0, 0, 0, 0, 0,
81
DRAFT_QUALITY, FIXED_PITCH|FF_MODERN, TEXT("") };
83
82
HFONT hfont = CreateFontIndirect(&logfont);
86
SendDlgItemMessage(hwnd,IDC_RAMINIT_PREVIEW,WM_SETFONT,
87
(WPARAM)hfont,MAKELPARAM(TRUE,0));
85
SendDlgItemMessage(hwnd, IDC_RAMINIT_PREVIEW, WM_SETFONT,
86
(WPARAM)hfont, MAKELPARAM(TRUE, 0));
89
88
resources_get_value("RAMInitStartValue", (void *)&orig_startvalue);
90
temp_hwnd=GetDlgItem(hwnd,IDC_RAMINIT_STARTVALUE);
89
temp_hwnd = GetDlgItem(hwnd,IDC_RAMINIT_STARTVALUE);
92
for (i = 0; ui_ram_startvalue[i] >= 0; i++)
91
for (i = 0; ui_ram_startvalue[i] >= 0; i++) {
96
94
_stprintf(s, TEXT("%d"), ui_ram_startvalue[i]);
97
SendMessage(temp_hwnd,CB_ADDSTRING,0,(LPARAM)s);
95
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)s);
98
96
if (orig_startvalue == ui_ram_startvalue[i])
99
SendMessage(temp_hwnd,CB_SETCURSEL,(WPARAM)i,0);
97
SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)i, 0);
102
100
resources_get_value("RAMInitValueInvert", (void *)&orig_valueinvert);
103
101
resources_get_value("RAMInitPatternInvert", (void *)&orig_patterninvert);
104
temp_hwnd=GetDlgItem(hwnd,IDC_RAMINIT_VALUEINVERT);
105
temp_hwnd2=GetDlgItem(hwnd,IDC_RAMINIT_PATTERNINVERT);
102
temp_hwnd = GetDlgItem(hwnd, IDC_RAMINIT_VALUEINVERT);
103
temp_hwnd2 = GetDlgItem(hwnd, IDC_RAMINIT_PATTERNINVERT);
107
for (i = 0; ui_ram_invertvalue[i] >= 0; i++)
105
for (i = 0; ui_ram_invertvalue[i] >= 0; i++) {
111
108
_stprintf(s, TEXT("%d"), ui_ram_invertvalue[i]);
112
SendMessage(temp_hwnd,CB_ADDSTRING,0,(LPARAM)s);
113
SendMessage(temp_hwnd2,CB_ADDSTRING,0,(LPARAM)s);
109
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)s);
110
SendMessage(temp_hwnd2, CB_ADDSTRING, 0, (LPARAM)s);
114
111
if (ui_ram_invertvalue[i] == orig_valueinvert)
115
SendMessage(temp_hwnd,CB_SETCURSEL,(WPARAM)i,0);
112
SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)i, 0);
116
113
if (ui_ram_invertvalue[i] == orig_patterninvert)
117
SendMessage(temp_hwnd2,CB_SETCURSEL,(WPARAM)i,0);
114
SendMessage(temp_hwnd2, CB_SETCURSEL, (WPARAM)i, 0);
120
117
update_preview(hwnd);
124
static BOOL CALLBACK dialog_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
121
static BOOL CALLBACK dialog_proc(HWND hwnd, UINT msg, WPARAM wparam,
131
command=LOWORD(wparam);
133
case IDC_RAMINIT_STARTVALUE:
134
rv = SendMessage(GetDlgItem(
135
hwnd,IDC_RAMINIT_STARTVALUE),CB_GETCURSEL,0,0);
136
resources_set_value("RAMInitStartValue",
137
(resource_value_t) ui_ram_startvalue[rv]);
138
update_preview(hwnd);
140
case IDC_RAMINIT_VALUEINVERT:
141
rv = SendMessage(GetDlgItem(
142
hwnd,IDC_RAMINIT_VALUEINVERT),CB_GETCURSEL,0,0);
143
resources_set_value("RAMInitValueInvert",
144
(resource_value_t) ui_ram_invertvalue[rv]);
145
update_preview(hwnd);
147
case IDC_RAMINIT_PATTERNINVERT:
148
rv = SendMessage(GetDlgItem(
149
hwnd,IDC_RAMINIT_PATTERNINVERT),CB_GETCURSEL,0,0);
150
resources_set_value("RAMInitPatternInvert",
151
(resource_value_t) ui_ram_invertvalue[rv]);
152
update_preview(hwnd);
129
command = LOWORD(wparam);
131
case IDC_RAMINIT_STARTVALUE:
132
rv = SendMessage(GetDlgItem(hwnd,
133
IDC_RAMINIT_STARTVALUE), CB_GETCURSEL, 0, 0);
134
resources_set_value("RAMInitStartValue",
135
(resource_value_t)ui_ram_startvalue[rv]);
136
update_preview(hwnd);
138
case IDC_RAMINIT_VALUEINVERT:
139
rv = SendMessage(GetDlgItem(
140
hwnd, IDC_RAMINIT_VALUEINVERT), CB_GETCURSEL, 0, 0);
141
resources_set_value("RAMInitValueInvert",
142
(resource_value_t)ui_ram_invertvalue[rv]);
143
update_preview(hwnd);
145
case IDC_RAMINIT_PATTERNINVERT:
146
rv = SendMessage(GetDlgItem(hwnd,
147
IDC_RAMINIT_PATTERNINVERT), CB_GETCURSEL, 0, 0);
148
resources_set_value("RAMInitPatternInvert",
149
(resource_value_t) ui_ram_invertvalue[rv]);
150
update_preview(hwnd);
159
resources_set_value("RAMInitStartValue",
160
(resource_value_t) orig_startvalue);
161
resources_set_value("RAMInitValueInvert",
162
(resource_value_t) orig_valueinvert);
163
resources_set_value("RAMInitPatternInvert",
164
(resource_value_t) orig_patterninvert);
157
resources_set_value("RAMInitStartValue",
158
(resource_value_t) orig_startvalue);
159
resources_set_value("RAMInitValueInvert",
160
(resource_value_t) orig_valueinvert);
161
resources_set_value("RAMInitPatternInvert",
162
(resource_value_t) orig_patterninvert);
170
168
EndDialog(hwnd,0);