Quantum Fog  0.9.3
C_EDIT_TABLE.h
1 #pragma once
2 
3 #include "C_CELL_EDITOR.h"
4 #include "C_SUB_MATRIX.h"
5 #include "C_ACTION_FLAGS.h"
6 enum SEL_MANAGER {editor_mgr, table_mgr};//selection manager is either the cell editor or the etable
7 //******************************************
8 class C_EDIT_TABLE : public LTableView, public LCommander, public C_ACTION_FLAGS
9 {
10 protected:
11  C_CELL_EDITOR * its_editor_p;
12  SInt16 its_font_size;
13  SInt16 its_font_num;
14  SEL_MANAGER its_sel_mgr;//sel_mgr = selection manager
15  enum {data_size=32};
16 public:
17  VOID set_text_traits_rid(ResIDT rid);
18  VOID init();
19  VOID FinishCreateSelf();
20  C_EDIT_TABLE(LStream * inStream);
21  virtual ~C_EDIT_TABLE();
22 
23  VOID set_max_chars_of_cell_editor(USHORT num);
24  BOOLEAN cell_editor_is_target() const;
25  VOID nullify_editor();
26 
27  virtual VOID get_cell_data(const STableCell & inCell, LStr255 & str);
28  virtual VOID set_cell_data(const STableCell & inCell, const LStr255 & str);
29  virtual BOOLEAN str_is_valid_cell_entry(const STableCell & cell, Str255 pstr);
30  virtual VOID delete_cell_data(const STableCell & inCell);
31  virtual VOID DrawCell(const STableCell & inCell, const Rect & inLocalRect);
32 
33 
34  virtual BOOLEAN unload_editor();
35  virtual VOID install_editor_at( const STableCell & cell);
36  virtual VOID Click(SMouseDownEvent & inMouseDown);
37  virtual VOID ClickSelf(const SMouseDownEvent & inMouseDown);
38  virtual VOID ClickCell(const STableCell & inCell, const SMouseDownEvent & inMouseDown);
39 
40  SEL_MANAGER get_sel_mgr() const;
41 
42  BOOLEAN sub_mat_can_be_pasted(const C_SUB_MATRIX & smat);
43  VOID resize_and_anchor_sub_mat_like_sel(C_SUB_MATRIX & smat);
44  VOID write_sub_mat(C_SUB_MATRIX & smat);
45  virtual VOID read_sub_mat(const C_SUB_MATRIX & smat);
46 
47  VOID copy_selection(C_SUB_MATRIX & smat, BOOLEAN fill_smat);
48  virtual VOID delete_selection();
49 
50  virtual BOOLEAN HandleKeyPress(const EventRecord & in_key_event);
51  virtual BOOLEAN ObeyCommand(CommandT inCommand, VOID * ioParam);
52  virtual VOID FindCommandStatus(CommandT inCommand,
53  BOOLEAN & outEnabled, BOOLEAN & outUsesMark,
54  UInt16 & outMark, Str255 outName_pstr);
55 
56 
57 };
58 #pragma mark -
59 
60 
61 //******************************************
62 inline
63 VOID C_EDIT_TABLE::set_max_chars_of_cell_editor(
64 USHORT num) //in
65 {
66  its_editor_p->SetMaxChars(num);
67 }
68 //******************************************
69 inline
70 BOOLEAN C_EDIT_TABLE::cell_editor_is_target() const
71 {
72  return its_editor_p->IsTarget();
73 }
74 //******************************************
75 inline
76 BOOLEAN C_EDIT_TABLE::str_is_valid_cell_entry(
77 const STableCell & cell, //in
78 Str255 pstr) //in
79 {
80  // should override this
81  return true;
82 }
83 
Definition: C_CELL_EDITOR.h:4
Definition: C_SUB_MATRIX.h:3
Definition: C_ACTION_FLAGS.h:13
Definition: C_EDIT_TABLE.h:8