~onli/simdock/master

« back to all changes in this revision

Viewing changes to src/launcher_dialog.cc

  • Committer: onli
  • Date: 2016-03-23 03:14:38 UTC
  • Revision ID: git-v1:27c983caf663a5fa655aa04e8d7b2242806e9830
Tags: 1.5
Support svg icons via wxsvg
Internally, wxwidgets and thus simdock still just uses
bitmaps. Support for svg is added by enabling the
launcherDialog to show .svg files, then passing them to
simimage where wxsvg converts them into a bitmap

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 */
18
18
#include "launcher_dialog.h"
19
19
 
 
20
using namespace std;
 
21
 
20
22
enum
21
23
{
22
24
ID_bmp_button = 99,
34
36
void LauncherDialog::SetIcon(const wxBitmap& value)
35
37
{
36
38
        wxBitmap v;
37
 
        if (value.GetWidth() != 50 || value.GetHeight() != 50)
38
 
        {
39
 
        v = value.ConvertToImage().Scale(50,50);
 
39
        if (value.GetWidth() != 50 || value.GetHeight() != 50) {
 
40
                v = value.ConvertToImage().Scale(50,50);
 
41
        } else {
 
42
                v = value;
40
43
        }
41
 
        else
42
 
        v = value;
43
 
 
44
44
        bmp_button->SetBitmapLabel(v);
45
45
}
46
46
 
145
145
        
146
146
        wxFileName fn(startingPath);
147
147
        
148
 
        wxString filename = wxFileSelector(_T("Choose a file to open"),fn.GetPath() /*wxPathOnly(startingPath)*/, _T(""), _T("png"), wxImage::GetImageExtWildcard(), wxFD_OPEN | wxFD_FILE_MUST_EXIST);
 
148
        wxString filename = wxFileSelector(_T("Choose a file to open"),fn.GetPath() /*wxPathOnly(startingPath)*/, _T(""), _T("png"), wxImage::GetImageExtWildcard() + ";*.svg", wxFD_OPEN | wxFD_FILE_MUST_EXIST);
149
149
 
150
150
        if ( !filename.empty() )
151
151
        {