Quantum Fog  0.9.3
C_ND_EFIELD.h
1 #pragma once
2 
3 #include "QFog_constants.h"
4 
5 //******************************************
6 class C_ND_EFIELD : public LEditField, public LBroadcaster
7 {
8 
9 protected:
10  USHORT its_nd;
11  enum { left_margin = 5}; // left and right margins will be the same
12  // PowerPlant sets top_magin sets equal to height -ascent
13 public:
14 
15  C_ND_EFIELD(LStream * inStream);
16  C_ND_EFIELD();
17  virtual ~C_ND_EFIELD();
19  const SPaneInfo & inPaneInfo,
20  Str255 in_pstr,
21  ResIDT inTextTraitsID,
22  SInt16 inMaxChars,
23  BOOLEAN inHasBox,
24  BOOLEAN inHasWordWrap,
25  TEKeyFilterFunc inKeyFilter,
26  LCommander * inSuper);
27  VOID FinishCreateSelf();
28 
29  USHORT get_nd();
30  VOID set_nd_always(USHORT nd);
31 
32  SInt16 get_fnum();
33  VOID set_fnum(SInt16 fnum);
34  SInt16 get_font_size();
35  VOID set_fsize(SInt16 fsize);
36 
37  SInt16 get_TE_width() const;
38  SInt16 get_TE_height() const;
39  SInt16 get_TE_ascent() const;
40  VOID calc_state_cap_frame(Rect & frame) const;
41 
42  VOID UserChangedText();
43  VOID DrawBox();
44  VOID undraw();
45  VOID EnableSelf();
46  VOID DisableSelf();
47 
48  VOID SpendTime( const EventRecord & inMacEvent );
49 
50 };
51 #pragma mark -
52 
53 
54 
55 //******************************************
56 inline
57 USHORT C_ND_EFIELD::get_nd()
58 {
59  return its_nd;
60 }
61 //******************************************
62 inline
63 VOID C_ND_EFIELD::set_nd_always(
64 USHORT nd) //in
65 {
66  its_nd= nd;
67 }
68 //******************************************
69 inline
70 SInt16 C_ND_EFIELD::get_fnum()
71 {
72  return (**mTextEditH).txFont;
73 }
74 //******************************************
75 inline
76 SInt16 C_ND_EFIELD::get_font_size()
77 {
78  return (**mTextEditH).txSize;
79 }
80 //******************************************
81 inline
82 SInt16 C_ND_EFIELD::get_TE_height() const
83 {
84  return (**mTextEditH).lineHeight;
85 }
86 //******************************************
87 inline
88 SInt16 C_ND_EFIELD::get_TE_ascent() const
89 {
90  return (**mTextEditH).fontAscent;
91 }
92 
Definition: C_ND_EFIELD.h:6