Changeset e43c8d0 in thomson for elec/CrO2/software/gui.cpp


Ignore:
Timestamp:
Mar 24, 2012, 3:26:03 PM (12 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
4a558d7
Parents:
fe55aa5
Message:

Some cleanup.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • elec/CrO2/software/gui.cpp

    rfe55aa5 re43c8d0  
    108108        IupSetAttribute(hexEd, "ALIGNMENT", "ALEFT");
    109109        Callback<Gui, const char*, int, int>::create(hexEd, "VALUE_CB", this, &Gui::matVal);
     110        Callback<Gui, int, int, int, const char*>::create(hexEd, "VALUE_EDIT_CB", this, &Gui::setMatVal);
    110111       
    111112        // WINDOW LAYOUT
     
    227228        return IUP_DEFAULT;
    228229}
     230
     231
     232int Gui::setMatVal(int x, int y, const char* val)
     233{
     234        int pos = (y-1) * 16 + (x-1);
     235
     236        if (file == NULL || selblock < 0 || selblock >= file->getBlockCount())
     237                return 0;
     238
     239        const Tape::Block& block = file->getBlock(selblock);
     240        block.data[pos] = 0; // TODO parse hex val to int
     241
     242        return 0;
     243}
     244
    229245
    230246const char* Gui::matVal(int y, int x)
Note: See TracChangeset for help on using the changeset viewer.