~onli/simdock/master

« back to all changes in this revision

Viewing changes to src/myFrame.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:
442
442
void
443
443
MyFrame::OnAdd (wxCommandEvent & event)
444
444
{
445
 
  simImage *sim = new simImage ();
446
 
  LauncherDialog *dlg = new LauncherDialog (this, sim);
447
 
  if (dlg->ShowModal () == wxID_OK)
448
 
    {
449
 
      if (dlg->saveChanges ())
450
 
        {
451
 
 
452
 
          sim->w = settings.ICONW;
453
 
          sim->h = settings.ICONH;
454
 
          sim->future_w = settings.ICONW;
455
 
          sim->future_h = settings.ICONH;
456
 
          sim->y =
457
 
            (settings.MAXSIZE + settings.BOTTOM_BORDER) - settings.ICONH -
458
 
            settings.BOTTOM_BORDER;
459
 
          ImagesList->Add (sim);
460
 
      bool changeIcons[ImagesList->GetCount()];
461
 
      fill_n(changeIcons, ImagesList->GetCount(), true);
462
 
          appSize = PositionIcons (settings, ImagesList, changeIcons);
463
 
          updateSize();
464
 
 
465
 
      saveLaunchers(ImagesList);
466
 
          Refresh (false);
467
 
 
468
 
        }
469
 
      else
470
 
        delete sim;
471
 
 
 
445
    simImage *sim = new simImage ();
 
446
    LauncherDialog *dlg = new LauncherDialog (this, sim);
 
447
    if (dlg->ShowModal () == wxID_OK) {
 
448
        if (dlg->saveChanges ()) {
 
449
            sim->w = settings.ICONW;
 
450
            sim->h = settings.ICONH;
 
451
            sim->future_w = settings.ICONW;
 
452
            sim->future_h = settings.ICONH;
 
453
            sim->y = (settings.MAXSIZE + settings.BOTTOM_BORDER) - settings.ICONH - settings.BOTTOM_BORDER;
 
454
            ImagesList->Add (sim);
 
455
            bool changeIcons[ImagesList->GetCount()];
 
456
            fill_n(changeIcons, ImagesList->GetCount(), true);
 
457
            appSize = PositionIcons (settings, ImagesList, changeIcons);
 
458
            updateSize();
 
459
 
 
460
            saveLaunchers(ImagesList);
 
461
            Refresh (false);
 
462
        } else {
 
463
            delete sim;
 
464
        }
 
465
    } else {
 
466
        delete sim;
472
467
    }
473
 
  else
474
 
    delete sim;
475
 
 
476
 
  dlg->Destroy ();
477
 
 
 
468
    dlg->Destroy ();
478
469
}
479
470
 
480
471
void MyFrame::OnKeep(wxCommandEvent & event) {