~ubuntu-branches/ubuntu/oneiric/ginkgocadx/oneiric

« back to all changes in this revision

Viewing changes to src/cadxcore/wx/thumbnailctrl/thumbnailwidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
ImportĀ upstreamĀ versionĀ 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id$
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
#pragma once
 
15
 
 
16
/*!
 
17
 * Includes
 
18
 */
 
19
 
 
20
////@begin includes
 
21
#include "wx/wx.h"
 
22
#include "wx/splitter.h"
 
23
#include "wx/dirctrl.h"
 
24
////@end includes
 
25
 
 
26
#include "thumbnailctrl.h"
 
27
 
 
28
/*!
 
29
 * Forward declarations
 
30
 */
 
31
 
 
32
////@begin forward declarations
 
33
class wxGenericDirCtrl;
 
34
class wxThumbnailCtrl;
 
35
////@end forward declarations
 
36
 
 
37
/*!
 
38
 * Control identifiers
 
39
 */
 
40
 
 
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
 
52
 
 
53
/*!
 
54
 * Compatibility
 
55
 */
 
56
 
 
57
#ifndef wxCLOSE_BOX
 
58
#define wxCLOSE_BOX 0x1000
 
59
#endif
 
60
 
 
61
/*!
 
62
 * wxThumbnailWidget class declaration
 
63
 */
 
64
 
 
65
class wxThumbnailWidget: public wxControl
 
66
{
 
67
    DECLARE_CLASS( wxThumbnailWidget )
 
68
    DECLARE_EVENT_TABLE()
 
69
 
 
70
public:
 
71
    /// Constructors
 
72
    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 );
 
74
 
 
75
    /// Creation
 
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 );
 
77
 
 
78
    /// Creates the controls and sizers
 
79
    void CreateControls();
 
80
 
 
81
    /// Shows the images in the given dir
 
82
    void ShowFolder(const wxString& path);
 
83
 
 
84
    /// Accessors
 
85
 
 
86
    void SetSelection(const wxString& filename);
 
87
    wxString GetSelection() const ;
 
88
    wxArrayString GetSelections() const ;
 
89
 
 
90
    /// Custom event handlers
 
91
    void OnLeftClick(wxThumbnailEvent& event);
 
92
    void OnLeftDClick(wxThumbnailEvent& event);
 
93
 
 
94
////@begin wxThumbnailWidget event handler declarations
 
95
 
 
96
    /// wxEVT_COMMAND_TREE_SEL_CHANGED event handler for ID_IMAGE_BROWSER_DIRCTRL
 
97
    void OnImageBrowserDirctrlSelChanged( wxTreeEvent& event );
 
98
 
 
99
////@end wxThumbnailWidget event handler declarations
 
100
 
 
101
////@begin wxThumbnailWidget member function declarations
 
102
 
 
103
////@end wxThumbnailWidget member function declarations
 
104
 
 
105
    /// Should we show tooltips?
 
106
    static bool ShowToolTips();
 
107
 
 
108
////@begin wxThumbnailWidget member variables
 
109
    wxGenericDirCtrl* m_dirCtrl;
 
110
    wxThumbnailCtrl* m_imageBrowser;
 
111
////@end wxThumbnailWidget member variables
 
112
 
 
113
    // Work around calling selection callback twice
 
114
    int m_selectionCount;
 
115
 
 
116
    // Initial path or filename, if set
 
117
    wxString m_initialSelection;
 
118
};
 
119