forked from ff6347/mpolauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MPOLnchTreeViewWidgetMgr.cpp
192 lines (154 loc) · 5.28 KB
/
MPOLnchTreeViewWidgetMgr.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
//========================================================================================
//
// $File: //depot/indesign_6.0/highprofile/source/sdksamples/wlistboxcomposite/MPOLnchTreeViewWidgetMgr.cpp $
//
// Owner: Danielle Darling
//
// $Author: pmbuilder $
//
// $DateTime: 2008/08/19 04:03:07 $
//
// $Revision: #1 $
//
// $Change: 643572 $
//
// Copyright 1997-2008 Adobe Systems Incorporated. All rights reserved.
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
// with the terms of the Adobe license agreement accompanying it. If you have received
// this file from a source other than Adobe, then your use, modification, or
// distribution of it requires the prior written permission of Adobe.
//
//========================================================================================
#include "VCPlugInHeaders.h"
#include "IControlView.h"
#include "IInLineEditController.h"
#include "IPanelControlData.h"
#include "ITextControlData.h"
#include "CTreeViewWidgetMgr.h"
#include "MPOLnchNodeID.h"
#include "MPOLnchID.h"
#include "MPOLnchRezDefs.h"
//interfaces
#include "IPanelControlData.h"
#include "IPalettePanelUtils.h"
#include "IControlView.h"
// the helper class holds the data for the scripts
#include "MPOLnchHelper.h"
// these are the ID Icons
#include "IconRsrcDefs.h"
/**
* Tree view manager
@ingroup mpolauncher
*/
class MPOLnchTVWidgetMgr : public CTreeViewWidgetMgr
{
public:
MPOLnchTVWidgetMgr(IPMUnknown *boss);
virtual ~MPOLnchTVWidgetMgr()
{}
virtual bool16 ApplyDataToWidget( const NodeID& node, IPanelControlData* widgetList, int32 message ) const;
void RegisterStyles()
{
RegisterStyleWidget(kLargePaletteRowsTreeStyle, kMPOLnchListElementRsrcID, kMPOLnchPluginID);
}
//void ChangeResourceID(IPanelControlData* widgetList) const ;
// void calcFristRsrcID()const;
RsrcID fMPOBtnRsrcID;
};
CREATE_PMINTERFACE(MPOLnchTVWidgetMgr, kMPOLnchTVWidgetMgrImpl)
MPOLnchTVWidgetMgr::MPOLnchTVWidgetMgr(IPMUnknown *boss) :
CTreeViewWidgetMgr(boss, kList),
fMPOBtnRsrcID(kMPOLnchMPOBtnIconRsrcID)
{
}
bool16 MPOLnchTVWidgetMgr::ApplyDataToWidget(const NodeID& node,
IPanelControlData* widgetList,
int32 message) const
{
do
{
TreeNodePtr<MPOLnchNodeID> nodeID(node);
PMString listName = nodeID->GetName();
IControlView* nameView = widgetList->FindWidget(kMPOLnchTextWidgetID);
InterfacePtr<ITextControlData> textControlData( nameView, UseDefaultIID() );
ASSERT(textControlData);
if( (textControlData== nil)) {
break;
}
MPOLnchHelper helper;
textControlData->SetString(listName);
IControlView* runView = widgetList->FindWidget(kMPOLnchListElementEyeballWidgetID);
if (listName.Contains(helper.GetNodeName(0),0)) {
runView->SetRsrcID(kMPOLnchMPOBtnIconRsrcID) ;
}else if (listName.Contains(helper.GetNodeName(1),0)) {
runView->SetRsrcID(kMPOLnchNUMBtnIconRsrcID) ;
}else if (listName.Contains(helper.GetNodeName(2),0)) {
runView->SetRsrcID(kMPOLnchCLSTYBtnIconRsrcID );
}else if (listName.Contains(helper.GetNodeName(3),0)) {
runView->SetRsrcID(kMPOLnchFCBtnIconRsrcID);
}else if (listName.Contains(helper.GetNodeName(4),0)) {
runView->SetRsrcID(kMPOLnchIFBtnIconRsrcID);
}else if (listName.Contains(helper.GetNodeName(5),0)) {
runView->SetRsrcID(kMPOLnchLNKBtnIconRsrcID);
}else if (listName.Contains(helper.GetNodeName(6),0)) {
runView->SetRsrcID(kMPOLnchIMGBtnIconRsrcID) ;
}else if (listName.Contains(helper.GetNodeName(7),0)) {
runView->SetRsrcID(kMPOLnchCLXMLBtnIconRsrcID) ;
}else if (listName.Contains(helper.GetNodeName(8),0)) {
runView->SetRsrcID(kMPOLnchCKEYBtnIconRsrcID );
}else if (listName.Contains(helper.GetNodeName(9),0)) {
runView->SetRsrcID(kMPOLnchCPAPBtnIconRsrcID);
}else if (listName.Contains(helper.GetNodeName(10),0)) {
runView->SetRsrcID(kMPOLnchCXXXBtnIconRsrcID );
}else if (listName.Contains(helper.GetNodeName(11),0)) {
runView->SetRsrcID(kMPOLnchCMXDBtnIconRsrcID);
}else if (listName.Contains(helper.GetNodeName(12),0)) {
runView->SetRsrcID(kMPOLnchQCKBtnIconRsrcID);
}else{}
//runView->Invalidate();
// InterfacePtr<IControlView> panelView(widgetList, UseDefaultIID());
// panelView->Invalidate();
} while (false);
return kTrue;
}
//void MPOLnchTVWidgetMgr::ChangeResourceID(IPanelControlData* widgetList)const
//{
//
// //InterfacePtr<IPanelControlData>
// //panelControlData(
// //Utils<IPalettePanelUtils>()->QueryPanelByWidgetID(kMPOLnchPanelWidgetID));
//
// //ASSERT(panelControlData);
//
// //if(!panelControlData) {
// // return;
// //}
//
//
// //IControlView* runView = widgetList->FindWidget(kMPOLnchListElementEyeballWidgetID);
// //ASSERT(runView);
// //if(!runView) {
//// return;
//// }
//
// this->calcFristRsrcID();
// runView->Invalidate();
//
// InterfacePtr<IControlView> panelView(widgetList, UseDefaultIID());
// ASSERT(panelView);
// //if(!panelView) {
//// return;
//// }
// panelView->Invalidate();
//
//
//
//}
//void MPOLnchTVWidgetMgr::calcFristRsrcID()const
//{
// //fCurrPictureRsrcID++;
// //if(fCurrPictureRsrcID > kPicIcoLastPictureRsrcID) {
// fMPOBtnRsrcID = kMPOLnchMPOBtnIconRsrcID;
// //}
//}