Quantum Fog  0.9.3
C_PALETTE.h
1 #pragma once
2 
3 #include "QFog_constants.h"
4 
5 #include "C_COLOR_SWATCH.h"
6 
7 
8 enum PALETTE_TOOL { no_tool=0,
9  selection_tool=1, drag_tool, open_tool,
10  rotation_tool, paint_tool, copy_color_tool,
11  arrow_tool, arrow_source_tool,
12  beam_spl_tool,
13  custom_nd_tool,
14  det_nd_tool,
15  pol_rot_tool,
16  polarizer_tool,
17  qbit_rot_tool,
18  sg_magnet_tool
19  };
20  //bi_nd selector is NOT a palette tool:
21  //a palette tool is global over documents, but a bi node tool isn't!
22 const PALETTE_TOOL first_nd_tool = beam_spl_tool;
23 
24 //For inspiration, see CSimplePalette in WindDiag PP example
25 //******************************************
26 class C_PALETTE : public LWindow, public LListener
27 {
28 
29 protected:
30  LTable * its_table_p;
31  LPopupButton * its_popup_p;
32 
33  C_COLOR_SWATCH * its_swatch_p;
34  PALETTE_TOOL its_cur_tool;
35 
36 public:
37 
38  C_PALETTE(LStream * inStream);
39  C_PALETTE();
40  VOID FinishCreateSelf();
41  virtual ~C_PALETTE();
42 
43  PALETTE_TOOL get_cur_tool();
44  VOID set_cur_tool(PALETTE_TOOL tool);
45 
46  const RGBColor & get_cur_color();
47  VOID set_cur_color(const RGBColor & color);
48 
49 
50  USHORT get_cur_popup_item() const;
51  VOID ListenToMessage(MessageT inMessage, VOID * ioParam );
52 
53 };
54 #pragma mark -
55 
56 
57 
58 //******************************************
59 inline
60 PALETTE_TOOL C_PALETTE::get_cur_tool()
61 {
62  return its_cur_tool;
63 }
64 //******************************************
65 inline
66 VOID C_PALETTE::set_cur_tool(
67 PALETTE_TOOL tool) //in
68 {
69  its_cur_tool = tool;
70 }
71 //******************************************
72 inline
73 const RGBColor & C_PALETTE::get_cur_color()
74 {
75  return its_swatch_p->get_cur_color();
76 }
77 //******************************************
78 inline
79 VOID C_PALETTE::set_cur_color(
80 const RGBColor & color) //in
81 {
82  its_swatch_p->set_cur_color(color);
83 }
84 
Definition: C_PALETTE.h:26
Definition: C_COLOR_SWATCH.h:4