1 /*
2  Copyright (C) 2010-2014 Kristian Duske
3 
4  This file is part of TrenchBroom.
5 
6  TrenchBroom is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  TrenchBroom is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef TrenchBroom_wxUtils
21 #define TrenchBroom_wxUtils
22 
23 #include "Color.h"
24 
25 #include <vector>
26 
27 #include <wx/colour.h>
28 
29 class wxBitmapButton;
30 class wxBitmapToggleButton;
31 class wxCursor;
32 class wxFrame;
33 class wxListCtrl;
34 class wxSizer;
35 class wxWindow;
36 
37 namespace TrenchBroom {
38     namespace View {
39         class MapFrame;
40 
41         MapFrame* findMapFrame(wxWindow* window);
42         wxFrame* findFrame(wxWindow* window);
43         bool isNonOwned(wxWindow* window);
44 
45         Color fromWxColor(const wxColor& color);
46         wxColor toWxColor(const Color& color);
47 
48         std::vector<size_t> getListCtrlSelection(const wxListCtrl* listCtrl);
49 
50         wxWindow* createBitmapButton(wxWindow* parent, const String& image, const String& tooltip);
51         wxWindow* createBitmapToggleButton(wxWindow* parent, const String& upImage, const String& downImage, const String& tooltip);
52 
53         wxSizer* wrapDialogButtonSizer(wxSizer* buttonSizer, wxWindow* parent);
54 
55         wxArrayString filterBySuffix(const wxArrayString& strings, const wxString& suffix, bool caseSensitive = false);
56     }
57 }
58 
59 #endif /* defined(TrenchBroom_wxUtils) */
60