Changeset b4f28e0 in git


Ignore:
Timestamp:
25/02/15 06:35:31 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
1b0bf6a
Parents:
261ab22
Message:

lib/icons/Makefile.am,lib/icons/xpm2png,src/mainfrm.cc: Fix display
of icons for toolbar and notebook under WXMSW.

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r261ab22 rb4f28e0  
     1Wed Feb 25 06:34:53 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * lib/icons/Makefile.am,lib/icons/xpm2png,src/mainfrm.cc: Fix display
     4          of icons for toolbar and notebook under WXMSW.
     5
    16Tue Feb 24 22:10:00 GMT 2015  Olly Betts <olly@survex.com>
    27
  • lib/icons/Makefile.am

    r261ab22 rb4f28e0  
    3030        pres_tree.xpm
    3131
    32 ico_files = $(xpm_files:.xpm=.ico)
     32# These ".rcdata" files are PNGs, but we end up with a loop of implicit rules
     33# if we call them ".png", and the .rc file doesn't care about the extension.
     34rcdata_files = $(xpm_files:.xpm=.rcdata)
    3335
    3436aven-icons.rc: Makefile.am
    35         perl -e 'for (@ARGV) { /(.*)\.ico$$/ and print "$$1 ICON $$_\n" }' \
    36           $(ico_files) > aven-icons.rc
     37        perl -e 'for (@ARGV) { /(.*)\.rcdata$$/ and $$1 ne "aven" and print "$$1 RCDATA $$_\n" }' \
     38          $(rcdata_files) > aven-icons.rc
    3739
    3840icondir = $(pkgdatadir)/icons
     
    7274        $(SHELL) $(srcdir)/xpm2winicon $< $@
    7375
     76.xpm.rcdata:
     77        $(SHELL) $(srcdir)/xpm2png $< $@
     78
    7479iconsets = Aven.iconset.zip svxedit.iconset.zip\
    7580        3d.iconset.zip err.iconset.zip plt.iconset.zip pos.iconset.zip\
     
    7883MAINTAINERCLEANFILES = $(iconsets)
    7984
    80 BUILT_SOURCES = aven-icons.rc $(ico_files)
     85BUILT_SOURCES = aven-icons.rc $(rcdata_files)
    8186
    8287EXTRA_DIST = png2winicon png2iconsetzip svg2iconsetzip\
    8388        aven-icons.rc\
    8489        $(xpm_files)\
    85         $(ico_files)\
     90        $(rcdata_files)\
    8691        aven.ico svxedit.ico\
    8792        3d.ico err.ico plt.ico pos.ico svx.ico\
  • src/mainfrm.cc

    r261ab22 rb4f28e0  
    5353#include <vector>
    5454
    55 #ifndef __WXMSW__
     55#ifdef __WXMSW__
     56#define TOOL(x) wxBitmap(wxT(#x), wxBITMAP_TYPE_PNG_RESOURCE)
     57#else
    5658// XPM files declare the array as static, but we also want it to be const too.
    5759// This avoids a compiler warning, and also means the data can go in a
     
    8688#include "../lib/icons/pres_tree.xpm"
    8789#undef static
     90#define TOOL(x) wxBITMAP(x)
    8891#endif
    8992
     
    992995
    993996    // FIXME: TRANSLATE tooltips
    994     toolbar->AddTool(wxID_OPEN, wxT("Open"), wxBITMAP(open), wxT("Open a survey file for viewing"));
    995     toolbar->AddTool(menu_PRES_OPEN, wxT("Open presentation"), wxBITMAP(open_pres), wxT("Open a presentation"));
     997    toolbar->AddTool(wxID_OPEN, wxT("Open"), TOOL(open), wxT("Open a survey file for viewing"));
     998    toolbar->AddTool(menu_PRES_OPEN, wxT("Open presentation"), TOOL(open_pres), wxT("Open a presentation"));
    996999    toolbar->AddSeparator();
    997     toolbar->AddCheckTool(menu_ROTATION_TOGGLE, wxT("Toggle rotation"), wxBITMAP(rotation), wxNullBitmap, wxT("Toggle rotation"));
    998     toolbar->AddTool(menu_ORIENT_PLAN, wxT("Plan"), wxBITMAP(plan), wxT("Switch to plan view"));
    999     toolbar->AddTool(menu_ORIENT_ELEVATION, wxT("Elevation"), wxBITMAP(elevation), wxT("Switch to elevation view"));
    1000     toolbar->AddTool(menu_ORIENT_DEFAULTS, wxT("Default view"), wxBITMAP(defaults), wxT("Restore default view"));
     1000    toolbar->AddCheckTool(menu_ROTATION_TOGGLE, wxT("Toggle rotation"), TOOL(rotation), wxNullBitmap, wxT("Toggle rotation"));
     1001    toolbar->AddTool(menu_ORIENT_PLAN, wxT("Plan"), TOOL(plan), wxT("Switch to plan view"));
     1002    toolbar->AddTool(menu_ORIENT_ELEVATION, wxT("Elevation"), TOOL(elevation), wxT("Switch to elevation view"));
     1003    toolbar->AddTool(menu_ORIENT_DEFAULTS, wxT("Default view"), TOOL(defaults), wxT("Restore default view"));
    10011004    toolbar->AddSeparator();
    1002     toolbar->AddCheckTool(menu_VIEW_SHOW_NAMES, wxT("Names"), wxBITMAP(names), wxNullBitmap, wxT("Show station names"));
    1003     toolbar->AddCheckTool(menu_VIEW_SHOW_CROSSES, wxT("Crosses"), wxBITMAP(crosses), wxNullBitmap, wxT("Show crosses on stations"));
    1004     toolbar->AddCheckTool(menu_VIEW_SHOW_ENTRANCES, wxT("Entrances"), wxBITMAP(entrances), wxNullBitmap, wxT("Highlight entrances"));
    1005     toolbar->AddCheckTool(menu_VIEW_SHOW_FIXED_PTS, wxT("Fixed points"), wxBITMAP(fixed_pts), wxNullBitmap, wxT("Highlight fixed points"));
    1006     toolbar->AddCheckTool(menu_VIEW_SHOW_EXPORTED_PTS, wxT("Exported points"), wxBITMAP(exported_pts), wxNullBitmap, wxT("Highlight exported stations"));
     1005    toolbar->AddCheckTool(menu_VIEW_SHOW_NAMES, wxT("Names"), TOOL(names), wxNullBitmap, wxT("Show station names"));
     1006    toolbar->AddCheckTool(menu_VIEW_SHOW_CROSSES, wxT("Crosses"), TOOL(crosses), wxNullBitmap, wxT("Show crosses on stations"));
     1007    toolbar->AddCheckTool(menu_VIEW_SHOW_ENTRANCES, wxT("Entrances"), TOOL(entrances), wxNullBitmap, wxT("Highlight entrances"));
     1008    toolbar->AddCheckTool(menu_VIEW_SHOW_FIXED_PTS, wxT("Fixed points"), TOOL(fixed_pts), wxNullBitmap, wxT("Highlight fixed points"));
     1009    toolbar->AddCheckTool(menu_VIEW_SHOW_EXPORTED_PTS, wxT("Exported points"), TOOL(exported_pts), wxNullBitmap, wxT("Highlight exported stations"));
    10071010    toolbar->AddSeparator();
    1008     toolbar->AddCheckTool(menu_VIEW_SHOW_LEGS, wxT("Underground legs"), wxBITMAP(ug_legs), wxNullBitmap, wxT("Show underground surveys"));
    1009     toolbar->AddCheckTool(menu_VIEW_SHOW_SURFACE, wxT("Surface legs"), wxBITMAP(surface_legs), wxNullBitmap, wxT("Show surface surveys"));
    1010     toolbar->AddCheckTool(menu_VIEW_SHOW_TUBES, wxT("Tubes"), wxBITMAP(tubes), wxNullBitmap, wxT("Show passage tubes"));
     1011    toolbar->AddCheckTool(menu_VIEW_SHOW_LEGS, wxT("Underground legs"), TOOL(ug_legs), wxNullBitmap, wxT("Show underground surveys"));
     1012    toolbar->AddCheckTool(menu_VIEW_SHOW_SURFACE, wxT("Surface legs"), TOOL(surface_legs), wxNullBitmap, wxT("Show surface surveys"));
     1013    toolbar->AddCheckTool(menu_VIEW_SHOW_TUBES, wxT("Tubes"), TOOL(tubes), wxNullBitmap, wxT("Show passage tubes"));
    10111014    toolbar->AddSeparator();
    1012     toolbar->AddCheckTool(menu_PRES_FREWIND, wxT("Fast Rewind"), wxBITMAP(pres_frew), wxNullBitmap, wxT("Very Fast Rewind"));
    1013     toolbar->AddCheckTool(menu_PRES_REWIND, wxT("Rewind"), wxBITMAP(pres_rew), wxNullBitmap, wxT("Fast Rewind"));
    1014     toolbar->AddCheckTool(menu_PRES_REVERSE, wxT("Backwards"), wxBITMAP(pres_go_back), wxNullBitmap, wxT("Play Backwards"));
    1015     toolbar->AddCheckTool(menu_PRES_PAUSE, wxT("Pause"), wxBITMAP(pres_pause), wxNullBitmap, wxT("Pause"));
    1016     toolbar->AddCheckTool(menu_PRES_PLAY, wxT("Go"), wxBITMAP(pres_go), wxNullBitmap, wxT("Play"));
    1017     toolbar->AddCheckTool(menu_PRES_FF, wxT("FF"), wxBITMAP(pres_ff), wxNullBitmap, wxT("Fast Forward"));
    1018     toolbar->AddCheckTool(menu_PRES_FFF, wxT("Very FF"), wxBITMAP(pres_fff), wxNullBitmap, wxT("Very Fast Forward"));
    1019     toolbar->AddTool(wxID_STOP, wxT("Stop"), wxBITMAP(pres_stop), wxT("Stop"));
     1015    toolbar->AddCheckTool(menu_PRES_FREWIND, wxT("Fast Rewind"), TOOL(pres_frew), wxNullBitmap, wxT("Very Fast Rewind"));
     1016    toolbar->AddCheckTool(menu_PRES_REWIND, wxT("Rewind"), TOOL(pres_rew), wxNullBitmap, wxT("Fast Rewind"));
     1017    toolbar->AddCheckTool(menu_PRES_REVERSE, wxT("Backwards"), TOOL(pres_go_back), wxNullBitmap, wxT("Play Backwards"));
     1018    toolbar->AddCheckTool(menu_PRES_PAUSE, wxT("Pause"), TOOL(pres_pause), wxNullBitmap, wxT("Pause"));
     1019    toolbar->AddCheckTool(menu_PRES_PLAY, wxT("Go"), TOOL(pres_go), wxNullBitmap, wxT("Play"));
     1020    toolbar->AddCheckTool(menu_PRES_FF, wxT("FF"), TOOL(pres_ff), wxNullBitmap, wxT("Fast Forward"));
     1021    toolbar->AddCheckTool(menu_PRES_FFF, wxT("Very FF"), TOOL(pres_fff), wxNullBitmap, wxT("Very Fast Forward"));
     1022    toolbar->AddTool(wxID_STOP, wxT("Stop"), TOOL(pres_stop), wxT("Stop"));
    10201023
    10211024    toolbar->AddSeparator();
     
    10241027    toolbar->AddControl(m_FindBox);
    10251028    /* TRANSLATORS: "Find stations" button tooltip */
    1026     toolbar->AddTool(wxID_FIND, wmsg(/*Find*/332), wxBITMAP(find)/*, "Search for station name"*/);
     1029    toolbar->AddTool(wxID_FIND, wmsg(/*Find*/332), TOOL(find)/*, "Search for station name"*/);
    10271030    /* TRANSLATORS: "Hide stations" button default tooltip */
    1028     toolbar->AddTool(button_HIDE, wmsg(/*Hide*/333), wxBITMAP(hideresults)/*, "Hide search results"*/);
     1031    toolbar->AddTool(button_HIDE, wmsg(/*Hide*/333), TOOL(hideresults)/*, "Hide search results"*/);
    10291032
    10301033    toolbar->Realize();
     
    10691072    // FIXME: this assumes images are 15x15
    10701073    wxImageList* image_list = new wxImageList(15, 15);
    1071     image_list->Add(wxBITMAP(survey_tree));
    1072     image_list->Add(wxBITMAP(pres_tree));
     1074    image_list->Add(TOOL(survey_tree));
     1075    image_list->Add(TOOL(pres_tree));
    10731076    m_Notebook->SetImageList(image_list);
    10741077    /* TRANSLATORS: labels for tabbed side panel this is for the tab with the
Note: See TracChangeset for help on using the changeset viewer.