/**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use ** Qt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ #include "macros.h" #include using namespace std; void EditMacro::init( Macros *k) { int anzahl,i; AllMacros=k; anzahl=AllMacros->Keywordcount(); if ( anzahl > 0 ) for(i=0; i < anzahl; i++) Keywords->insertItem(AllMacros->getKeyword(i)); anzahl=AllMacros->count(); Position->setMaxValue(anzahl-1); SelectMacro->insertItem(" "); for(i=0; i < anzahl; i++) SelectMacro->insertItem(AllMacros->getMacroName(i)); } void EditMacro::setText( int Number) { if( Number > 0) { Number--; Position->setValue(Number); Definition->setText(AllMacros->getDefinition(Number)); Accelerator->setText(AllMacros->getAccelerator(Number)); } } void EditMacro::accept() { int AktPosition, NewPosition; AktPosition=SelectMacro->currentItem()-1; AllMacros->setDefinition(Definition->text(),AktPosition); AllMacros->setAccelerator(Accelerator->text(),AktPosition); /** Position Change to be done later NewPosition=Position->value(); if (AktPosition != NewPosition ) { swap(AllMacros->MacroNames[AktPosition],AllMacros->MacroNames[NewPosition]); swap(AllMacros->MacroText[AktPosition],AllMacros->MacroText[NewPosition]); } **/ QDialog::accept(); }