]> git.saurik.com Git - wxWidgets.git/blob - src/mac/ldef/extldef.c
Mac-ify wxTreeCtrl further.
[wxWidgets.git] / src / mac / ldef / extldef.c
1 #include "extldef.h"
2
3 /*************************************************************************
4
5 function prototypes
6
7 *************************************************************************/
8
9 void DrawMsg(Boolean fSelect, Rect *r, Cell cell, ListHandle lh);
10 void HiliteMsg(Boolean fSelect, Rect *r);
11
12 /*************************************************************************
13
14 main
15
16 *************************************************************************/
17
18 pascal void main(short message, Boolean fSelect, Rect *r, Cell cell,
19 short dataOffset, short dataLen, ListHandle lh)
20 {
21
22 switch(message) {
23 case lInitMsg:
24 break;
25
26 case lDrawMsg:
27 DrawMsg(fSelect, r, cell, lh);
28 break;
29
30 case lHiliteMsg:
31 HiliteMsg(fSelect, r);
32 break;
33
34 case lCloseMsg:
35 break;
36
37 default:
38 break;
39 }
40 }
41
42 /*************************************************************************
43
44 DrawMsg
45
46 *************************************************************************/
47
48 void DrawMsg(Boolean fSelect, Rect *r, Cell cell, ListHandle lh)
49 {
50 ExtLDEFInfo* info = (ExtLDEFInfo*) (**lh).refCon ;
51 GrafPtr savePort;
52
53 // set up the port
54 GetPort(&savePort);
55 SetPort((**lh).port);
56 PenNormal();
57 ForeColor( blackColor ) ;
58 BackColor( whiteColor ) ;
59
60 EraseRect(r);
61 if ( info )
62 {
63 if ( info->drawProc)
64 {
65 CallExtLDEFDrawProc(info->drawProc, r, cell, lh, info->refCon );
66 }
67
68 }
69 // hilite if selected
70 if (fSelect)
71 HiliteMsg(fSelect, r);
72
73 SetPort(savePort);
74
75 }
76
77 /*************************************************************************
78
79 HiliteMsg
80
81 *************************************************************************/
82
83 void HiliteMsg(Boolean fSelect, Rect *r)
84 {
85 unsigned char hMode;
86
87 hMode = LMGetHiliteMode();
88 BitClr((Ptr)(&hMode),(long)pHiliteBit);
89 LMSetHiliteMode(hMode);
90 InvertRect(r);
91 }