|
3 | 3 |
|
4 | 4 | #include "DOOneColor.h" |
5 | 5 | #include "DOShuffle.h" |
6 | | -#include "../ECore/Editor/ColorPicker.h" |
| 6 | +#include "editors/ECore/Editor/ColorPicker.h" |
7 | 7 | //--------------------------------------------------------------------------- |
8 | 8 | #pragma package(smart_init) |
9 | 9 | #pragma link "ElXPThemedControl" |
10 | 10 | #pragma link "ExtBtn" |
11 | 11 | #pragma resource "*.dfm" |
12 | 12 | //--------------------------------------------------------------------------- |
13 | | -__fastcall TfrmOneColor::TfrmOneColor(TComponent* Owner) |
14 | | - : TForm(Owner) |
15 | | -{ |
16 | | -} |
| 13 | +__fastcall TfrmOneColor::TfrmOneColor(TComponent *Owner) |
| 14 | + : TForm(Owner) {} |
| 15 | + |
17 | 16 | //--------------------------------------------------------------------------- |
18 | 17 |
|
19 | | -void __fastcall TfrmOneColor::ShowIndex(TfrmDOShuffle* parent) |
| 18 | +void __fastcall TfrmOneColor::ShowIndex(TfrmDOShuffle *parent) |
20 | 19 | { |
21 | | - m_Parent = parent; |
22 | | -// VERIFY(stage); |
23 | | -// m_CurStage = stage; |
| 20 | + m_Parent = parent; |
| 21 | + // VERIFY(stage); |
| 22 | + // m_CurStage = stage; |
24 | 23 |
|
25 | 24 | bLoadMode = true; |
26 | | -// if (m_CurStage){ |
27 | | -// } |
| 25 | + // if (m_CurStage){ |
| 26 | + // } |
28 | 27 | bLoadMode = false; |
29 | | - Visible=true; |
| 28 | + Visible = true; |
30 | 29 | } |
| 30 | + |
31 | 31 | //--------------------------------------------------------------------------- |
32 | 32 |
|
33 | | -void __fastcall TfrmOneColor::HideIndex(){ |
34 | | - Visible=false; |
| 33 | +void __fastcall TfrmOneColor::HideIndex() |
| 34 | +{ |
| 35 | + Visible = false; |
35 | 36 | } |
| 37 | + |
36 | 38 | //--------------------------------------------------------------------------- |
37 | 39 |
|
38 | 40 | void __fastcall TfrmOneColor::mcColorMouseDown(TObject *Sender, |
39 | | - TMouseButton Button, TShiftState Shift, int X, int Y) |
| 41 | + TMouseButton Button, TShiftState Shift, int X, int Y) |
40 | 42 | { |
41 | | - u32 color = ((TMultiObjColor*)Sender)->Brush->Color; |
42 | | - if (SelectColorWin(&color)){ |
43 | | - ((TMultiObjColor*)Sender)->_Set(color); |
44 | | - m_Parent->bColorIndModif = true; |
| 43 | + u32 color = ((TMultiObjColor*)Sender)->Brush->Color; |
| 44 | + if (SelectColorWin(&color)) |
| 45 | + { |
| 46 | + ((TMultiObjColor*)Sender)->_Set(color); |
| 47 | + m_Parent->bColorIndModif = true; |
45 | 48 | } |
46 | 49 | } |
| 50 | + |
47 | 51 | //--------------------------------------------------------------------------- |
48 | 52 |
|
49 | 53 | void __fastcall TfrmOneColor::FormClose(TObject *Sender, |
50 | | - TCloseAction &Action) |
| 54 | + TCloseAction &Action) |
51 | 55 | { |
52 | | - Action = caFree; |
| 56 | + Action = caFree; |
53 | 57 | m_Parent->RemoveColorIndex(this); |
54 | 58 | } |
| 59 | + |
55 | 60 | //--------------------------------------------------------------------------- |
56 | 61 |
|
57 | 62 | void __fastcall TfrmOneColor::ebMultiRemoveClick(TObject *Sender) |
58 | 63 | { |
59 | | - Close(); |
| 64 | + Close(); |
60 | 65 | } |
| 66 | + |
61 | 67 | //--------------------------------------------------------------------------- |
62 | 68 |
|
63 | 69 | void __fastcall TfrmOneColor::tvDOListDragOver(TObject *Sender, |
64 | | - TObject *Source, int X, int Y, TDragState State, bool &Accept) |
| 70 | + TObject *Source, int X, int Y, TDragState State, bool &Accept) |
65 | 71 | { |
66 | 72 | Accept = false; |
67 | | - if (Source == tvDOList) return; |
68 | | - if (Source != m_Parent->tvItems) return; |
69 | | - for ( TElTreeItem* node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
70 | | - if (node->Text == m_Parent->FDragItem->Text) return; |
71 | | - Accept = true; |
| 73 | + if (Source==tvDOList) |
| 74 | + return; |
| 75 | + if (Source!=m_Parent->tvItems) |
| 76 | + return; |
| 77 | + for (TElTreeItem *node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
| 78 | + if (node->Text==m_Parent->FDragItem->Text) |
| 79 | + return; |
| 80 | + Accept = true; |
72 | 81 | } |
| 82 | + |
73 | 83 | //--------------------------------------------------------------------------- |
74 | 84 |
|
75 | 85 | void __fastcall TfrmOneColor::tvDOListDragDrop(TObject *Sender, |
76 | | - TObject *Source, int X, int Y) |
| 86 | + TObject *Source, int X, int Y) |
77 | 87 | { |
78 | | - tvDOList->Items->AddObject(0,m_Parent->FDragItem->Text,m_Parent->FDragItem->Data); |
79 | | - m_Parent->bColorIndModif = true; |
| 88 | + tvDOList->Items->AddObject(0, m_Parent->FDragItem->Text, m_Parent->FDragItem->Data); |
| 89 | + m_Parent->bColorIndModif = true; |
80 | 90 | } |
| 91 | + |
81 | 92 | //--------------------------------------------------------------------------- |
82 | 93 |
|
83 | 94 | void __fastcall TfrmOneColor::tvDOListStartDrag(TObject *Sender, |
84 | | - TDragObject *&DragObject) |
| 95 | + TDragObject *&DragObject) |
85 | 96 | { |
86 | | - FDragItem = tvDOList->ItemFocused; |
| 97 | + FDragItem = tvDOList->ItemFocused; |
87 | 98 | } |
| 99 | + |
88 | 100 | //--------------------------------------------------------------------------- |
89 | 101 |
|
90 | | -void __fastcall TfrmOneColor::RemoveObject(LPCSTR text){ |
91 | | - for ( TElTreeItem* node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
92 | | - if (node->Text == (WideString)text){ |
93 | | - node->Delete(); |
94 | | - return; |
| 102 | +void __fastcall TfrmOneColor::RemoveObject(LPCSTR text) |
| 103 | +{ |
| 104 | + for (TElTreeItem *node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
| 105 | + if (node->Text==(WideString)text) |
| 106 | + { |
| 107 | + node->Delete(); |
| 108 | + return; |
95 | 109 | } |
96 | 110 | } |
97 | 111 |
|
98 | 112 | void __fastcall TfrmOneColor::AppendObject(LPCSTR text, LPVOID data) |
99 | 113 | { |
100 | | - for ( TElTreeItem* node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
101 | | - if (node->Text == (WideString)text) return; |
102 | | - tvDOList->Items->AddObject(0,text,data); |
| 114 | + for (TElTreeItem *node = tvDOList->Items->GetFirstNode(); node; node = node->GetNext()) |
| 115 | + if (node->Text==(WideString)text) |
| 116 | + return; |
| 117 | + tvDOList->Items->AddObject(0, text, data); |
103 | 118 | } |
104 | 119 |
|
105 | 120 | void __fastcall TfrmOneColor::tvDOListItemFocused(TObject *Sender) |
106 | 121 | { |
107 | | - m_Parent->OnItemFocused (tvDOList); |
| 122 | + m_Parent->OnItemFocused(tvDOList); |
108 | 123 | } |
| 124 | + |
109 | 125 | //--------------------------------------------------------------------------- |
110 | 126 |
|
111 | 127 |
|
0 commit comments