-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPPCOMBOB.C
More file actions
65 lines (56 loc) · 1.71 KB
/
Copy pathPPCOMBOB.C
File metadata and controls
65 lines (56 loc) · 1.71 KB
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
/*-----------------------------------------------------------------------------
Paper Plane cUI Combo Window ToolBar
-----------------------------------------------------------------------------*/
#include "WINAPI.H"
#include <commctrl.h>
#include "PPX.H"
#include "VFS.H"
#include "PPC_STRU.H"
#include "PPC_FUNC.H"
#include "PPCOMBO.H"
#pragma hdrstop
#define TOOLBAR_CMDID 0x1000
#define xTBSTYLE_CUSTOMERASE 0x2000
void ComboCreateToolBar(HWND hWnd)
{
RECT box;
UINT ID = TOOLBAR_CMDID;
HWND hBarWnd;
if ( WinColors.ExtraDrawFlags & EDF_DIALOG_BACK ) LoadCCDrawBack();
hBarWnd = CreateToolBar(&Combo_thGuiWork, hWnd, &ID, T("B_cdef"), PPcPath,
(WinColors.ExtraDrawFlags & EDF_DIALOG_BACK) ?
xTBSTYLE_CUSTOMERASE : 0);
Combo.ToolBar.hWnd = hBarWnd;
if ( hBarWnd != NULL ){
GetWindowRect(hBarWnd, &box);
Combo.ToolBar.Height = box.bottom - box.top;
}
}
void ComboToolbarCommand(int id, int orcode)
{
RECT box;
POINT pos;
TCHAR *cmd;
SendMessage(Combo.ToolBar.hWnd, TB_GETRECT, (WPARAM)id, (LPARAM)&box);
pos.x = box.left;
pos.y = box.bottom;
ClientToScreen(Combo.ToolBar.hWnd, &pos);
cmd = GetToolBarCmd(Combo.ToolBar.hWnd, &Combo_thGuiWork, id);
if ( cmd == NULL ) return;
if ( orcode ){
WORD key;
key = *(WORD *)(cmd + 1) | (WORD)orcode;
if ( key == (K_s | K_raw | K_bs) ){
key = K_raw | K_c | K_bs;
}
SendMessage(hComboFocusWnd, WM_PPXCOMMAND,
TMAKELPARAM(K_POPOPS, PPT_SAVED), TMAKELPARAM(pos.x, pos.y));
SendMessage(hComboFocusWnd, WM_PPXCOMMAND, key, 0);
}else{
int i;
i = GetComboShowIndex(hComboFocusWnd);
if ( i < 0 ) return;
if ( Combo.base[Combo.show[i].baseNo].cinfo == NULL ) return;
SendMessage(hComboFocusWnd, WM_PPCEXEC, (WPARAM)cmd, TMAKELPARAM(pos.x, pos.y));
}
}