6
* Copyright 2008-10 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
22
#include "wx/splitter.h"
23
#include "wx/dirctrl.h"
26
#include "thumbnailctrl.h"
29
* Forward declarations
32
////@begin forward declarations
33
class wxGenericDirCtrl;
34
class wxThumbnailCtrl;
35
////@end forward declarations
41
////@begin control identifiers
42
#define ID_IMAGE_BROWSER_DIALOG 21500
43
#define SYMBOL_wxThumbnailWidget_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
44
#define SYMBOL_wxThumbnailWidget_TITLE _("Image Browser Dialog")
45
#define SYMBOL_wxThumbnailWidget_IDNAME ID_IMAGE_BROWSER_DIALOG
46
#define SYMBOL_wxThumbnailWidget_SIZE wxSize(400, 300)
47
#define SYMBOL_wxThumbnailWidget_POSITION wxPoint(0, 0)
48
#define ID_IMAGE_BROWSER_SPLITTER 21501
49
#define ID_IMAGE_BROWSER_DIRCTRL 21502
50
#define ID_IMAGE_BROWSER_BROWSER 21503
51
////@end control identifiers
58
#define wxCLOSE_BOX 0x1000
62
* wxThumbnailWidget class declaration
65
class wxThumbnailWidget: public wxControl
67
DECLARE_CLASS( wxThumbnailWidget )
73
wxThumbnailWidget( wxWindow* parent, wxWindowID id = SYMBOL_wxThumbnailWidget_IDNAME, const wxString& caption = SYMBOL_wxThumbnailWidget_TITLE, const wxPoint& pos = SYMBOL_wxThumbnailWidget_POSITION, const wxSize& size = SYMBOL_wxThumbnailWidget_SIZE, long style = SYMBOL_wxThumbnailWidget_STYLE );
76
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_wxThumbnailWidget_IDNAME, const wxString& caption = SYMBOL_wxThumbnailWidget_TITLE, const wxPoint& pos = SYMBOL_wxThumbnailWidget_POSITION, const wxSize& size = SYMBOL_wxThumbnailWidget_SIZE, long style = SYMBOL_wxThumbnailWidget_STYLE );
78
/// Creates the controls and sizers
79
void CreateControls();
81
/// Shows the images in the given dir
82
void ShowFolder(const wxString& path);
86
void SetSelection(const wxString& filename);
87
wxString GetSelection() const ;
88
wxArrayString GetSelections() const ;
90
/// Custom event handlers
91
void OnLeftClick(wxThumbnailEvent& event);
92
void OnLeftDClick(wxThumbnailEvent& event);
94
////@begin wxThumbnailWidget event handler declarations
96
/// wxEVT_COMMAND_TREE_SEL_CHANGED event handler for ID_IMAGE_BROWSER_DIRCTRL
97
void OnImageBrowserDirctrlSelChanged( wxTreeEvent& event );
99
////@end wxThumbnailWidget event handler declarations
101
////@begin wxThumbnailWidget member function declarations
103
////@end wxThumbnailWidget member function declarations
105
/// Should we show tooltips?
106
static bool ShowToolTips();
108
////@begin wxThumbnailWidget member variables
109
wxGenericDirCtrl* m_dirCtrl;
110
wxThumbnailCtrl* m_imageBrowser;
111
////@end wxThumbnailWidget member variables
113
// Work around calling selection callback twice
114
int m_selectionCount;
116
// Initial path or filename, if set
117
wxString m_initialSelection;