Ignore:
Timestamp:
Dec 24, 2009, 4:17:54 AM (10 years ago)
Author:
sven
Message:

Punch Card Editor, ongoing development

  • Extended new Deck interface, expanding the undo framework
  • Implemented editor changes via undo framework
  • revised the menu and toolbar actions and structure (now dynamic construction at deck load time), implemented undo viewer
  • Started implementation of device driver framework in menu
  • Embedded the Qextserialport library (http://qextserialport.sourceforge.net/)
  • Started the Documation M200 Client device driver (well, just created the directory structure and qmake project file infrastructure)
  • At the current state, the complete project compiles :-)

Statistics: About 3500 Lines of code (without libqextserialport)

-- sven @ workstation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • punch-card/punch-card-editor/src/text/editor.h

    r52 r53  
    88namespace Text {
    99        class Editor;
     10        class CharUndoCommand;
     11        class StringUndoCommand;
    1012};
    1113};
     
    1416#include "deckviewer/cardeditor.h"
    1517#include "qpunchcard/card.h"
     18#include "qpunchcard/deck.h"
    1619#include "text/editordock.h"
    1720#include "text/codec.h"
     
    7881        void translateChanges(int position, int charsRemoved, int charsAdded);
    7982
    80 }; // class
     83}; // class Editor
     84
     85/*
     86class CharUndoCommand : public DeckUndoCommand {
     87        CharUndoCommand(Deck* editor, DeckIndex& position, CardIndex column, Card old_content,
     88                        const Codec* codec, char new_char, QUndoCommand *parent = 0) :
     89                DeckUndoCommand(deck, parent), column(column), old_content(old_content),
     90                codec(codec), new_char(new_char) {
     91        }
     92
     93                old_content = *position.getCard();
     94                setText(position.getDeck()->tr("Changed contents of card").arg(position));
     95        }
     96        void undo() { position.getDeck()->cards[position] = old_content; }
     97        void redo() { position.getDeck()->cards[position] = new_content; }
     98private:
     99        DeckIndex position;
     100        Card old_content;
     101        CardIndex column;
     102        const Codec* codec;
     103        char new_char;
     104}; // class CharUndoCommand
     105*/
     106
     107/*
     108class ModifyLine : public DeckModifyCard {
     109public:
     110        ModifyLine(Deck* deck, const QString& new_text, const Codec* codec,
     111                   DeckIndex& position, QUndoCommand* parent=0) : DeckModifyCard(deck, position, Card, parent) {
     112                codec->fromAscii(codec, &new_content);
     113                position.assertDeck(deck);
     114                Q_ASSERT(this->deck);
     115
     116                // alten Inhalt irgendwie sichern
     117                old_content = *position.getCard();
     118                setText(position.getDeck()->tr("Changed contents of card").arg(position));
     119        }
     120        void undo() { position.getDeck()->cards[position] = old_content; }
     121        void redo() { position.getDeck()->cards[position] = new_content; }
     122private:
     123
     124        DeckIndex position;
     125        Card new_content;
     126        Card old_content;
     127};
     128*/
     129
    81130
    82131}; // namespace Text
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License