ASPiK SDK
uibitmapscontroller.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #ifndef __uibitmapscontroller__
6 #define __uibitmapscontroller__
7 
8 #include "../uidescription.h"
9 
10 #if VSTGUI_LIVE_EDITING
11 
12 #include "uiselection.h"
13 #include "uiundomanager.h"
14 #include "iaction.h"
15 #include "../delegationcontroller.h"
16 #include "../../lib/cdatabrowser.h"
17 
18 namespace VSTGUI {
19 class UIBitmapsDataSource;
20 
21 //----------------------------------------------------------------------------------------------------
22 class UIBitmapsController : public CBaseObject, public DelegationController, public IGenericStringListDataBrowserSourceSelectionChanged
23 {
24 public:
25  UIBitmapsController (IController* baseController, UIDescription* description, IActionPerformer* actionPerformer);
26  ~UIBitmapsController () override;
27 
28 protected:
29  CView* createView (const UIAttributes& attributes, const IUIDescription* description) override;
30  CView* verifyView (CView* view, const UIAttributes& attributes, const IUIDescription* description) override;
31  IControlListener* getControlListener (UTF8StringPtr name) override;
32  void valueChanged (CControl* pControl) override;
33 
34  void dbSelectionChanged (int32_t selectedRow, GenericStringListDataBrowserSource* source) override;
35 
36  void showSettingsDialog ();
37 
38  static bool valueToString (float value, char utf8String[256], void* userData);
39  static bool stringToValue (UTF8StringPtr txt, float& result, void* userData);
40 
41  SharedPointer<UIDescription> editDescription;
42  IActionPerformer* actionPerformer;
43  UIBitmapsDataSource* dataSource;
44  SharedPointer<CView> bitmapView;
45  SharedPointer<CTextEdit> bitmapPathEdit;
46  SharedPointer<CControl> settingButton;
47 
48  enum {
49  kAddTag = 0,
50  kRemoveTag,
51  kSearchTag,
52  kBitmapPathTag,
53  kSettingsTag
54  };
55 };
56 
57 } // namespace
58 
59 #endif // VSTGUI_LIVE_EDITING
60 
61 #endif // __uibitmapscontroller__
Definition: customcontrols.cpp:8