~onli/simdock/master

« back to all changes in this revision

Viewing changes to src/launcher_dialog.cc

  • Committer: onli
  • Date: 2018-05-11 15:29:21 UTC
  • Revision ID: git-v1:881a8f9f0ba0ec4096cd79ca823bc90c6beaa6a4
Move from wxsvg to librsvg
wxsvg dies with an error, see https://sourceforge.net/p/wxsvg/discussion/424987/thread/c8717ee8/. This can be a temporary fix, but in fact I hope that rsvg can render the svgs in higher quality

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
 
90
90
    
91
91
    wxBoxSizer* Horizontal0 = new wxBoxSizer( wxHORIZONTAL );
92
92
    
93
 
    bmp_button = new wxBitmapButton(this,ID_bmp_button,NULL,wxDefaultPosition,wxSize(60,60));
94
 
    SetIcon(wxBitmap(launcher->img));
 
93
    bmp_button = new wxButton(this,ID_bmp_button,_T("Icon"),wxDefaultPosition,wxSize(60,60));
 
94
        if (launcher->img.IsOk()) {
 
95
                SetIcon(wxBitmap(launcher->img));
 
96
        }
95
97
    Horizontal0->Add(bmp_button,0,5);
96
98
    LauncherBox->Add(Horizontal0, 0, wxGROW|wxALL, 5);
97
99
    
143
145
        
144
146
        wxFileName fn(startingPath);
145
147
        
146
 
        wxString filename = wxFileSelector(_T("Choose a file to open"),fn.GetPath() /*wxPathOnly(startingPath)*/, _T(""), _T("png"), wxImage::GetImageExtWildcard(), wxOPEN | wxFILE_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);
147
149
 
148
150
        if ( !filename.empty() )
149
151
        {