Changeset 4a558d7 in thomson


Ignore:
Timestamp:
Mar 24, 2012, 5:10:40 PM (12 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
e017851
Parents:
e43c8d0
Message:
  • Use graphical buttons for play/rec
  • Show error message when play fails.

git-svn-id: svn://localhost/thomson@27 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

Location:
elec/CrO2/software
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • elec/CrO2/software/Makefile

    re43c8d0 r4a558d7  
    1515CC              = g++
    1616CPPFLAGS = $(USBFLAGS) -Os -Wall -I/local/include -std=c++0x -mthreads
    17 LIBS = $(USBLIBS) -Os -mwindows -liup -liupcontrols -liupcd -lcd -lfreetype -lz -lcomctl32 -lole32 -mthreads
     17LIBS = $(USBLIBS) -Os -mwindows -liup -liupimglib -liupcontrols -liupcd -lcd \
     18        -lfreetype -lz -lcomctl32 -lole32 -mthreads
    1819
    1920PROJECT = CrO2
  • elec/CrO2/software/gui.cpp

    re43c8d0 r4a558d7  
    5555        IupOpen(argc, argv);
    5656        IupControlsOpen();
     57        IupImageLibOpen();
    5758
    5859        Ihandle* menu_open = IupItem("Open", NULL);
     
    7677        IupSetAttribute(motoron, "RASTERSIZE", "16x16");
    7778
    78         Ihandle* playToggle = IupToggle("play", NULL);
    79         Callback<Gui, int, int>::create(playToggle, "ACTION", this, &Gui::setPlaying);
     79        playToggle = IupToggle("play", NULL);
     80        IupSetAttribute(playToggle, "ACTIVE", "NO");
     81        IupSetAttribute(playToggle, "IMAGE", "IUP_MediaPlay");
     82        Callback<Gui, int, int>::create(playToggle, "ACTION", this,
     83                &Gui::setPlaying);
     84
     85        Ihandle* recToggle = IupToggle("rec", NULL);
     86        IupSetAttribute(recToggle, "ACTIVE", "NO");
     87        IupSetAttribute(recToggle, "IMAGE", "IUP_MediaRecord");
    8088
    8189        // EXPLORE
     
    120128                        IupHbox(
    121129                                playToggle,
    122                                 IupToggle("REC",NULL),
     130                                recToggle,
    123131                                NULL
    124132                        ),
     
    203211                        }
    204212                }
     213
     214                // Enable play button
     215                IupSetAttribute(playToggle, "ACTIVE", "YES");
    205216        }
    206217        return IUP_DEFAULT;
     
    306317        {
    307318                // pause
    308         } else {
     319        } else try {
    309320                // play
    310321                Device::getDevice().write(*file);
     322        } catch (const char* ex) {
     323                IupMessage("CrO2 error", ex);
    311324        }
    312325
  • elec/CrO2/software/gui.h

    re43c8d0 r4a558d7  
    3434                Ihandle* blocklist;
    3535                Ihandle* hexEd;
     36                Ihandle* playToggle;
    3637};
Note: See TracChangeset for help on using the changeset viewer.