├── .gitignore ├── LICENSE.GPL ├── README.md ├── main.cpp ├── rc.rc ├── resource.qrc ├── wxNote.pro ├── wxNote_Global.cpp ├── wxNote_Global.h ├── wxNote_Gui ├── wxNote_Button │ ├── EliminateOrRestorePushButton.cpp │ ├── EliminateOrRestorePushButton.h │ ├── NestingButton.cpp │ ├── NestingButton.h │ ├── wxNote_ToolButton.cpp │ └── wxNote_ToolButton.h ├── wxNote_Dialog │ ├── AboutDialog.cpp │ ├── AboutDialog.h │ ├── CommonDialog.cpp │ ├── CommonDialog.h │ ├── GetNameForNewNotebook.cpp │ ├── GetNameForNewNotebook.h │ ├── GetPasswordDialog.cpp │ ├── GetPasswordDialog.h │ ├── InsertTableDialog.cpp │ ├── InsertTableDialog.h │ ├── OptionsDialog.cpp │ ├── OptionsDialog.h │ ├── SetPasswordDialog.cpp │ └── SetPasswordDialog.h ├── wxNote_Edit │ ├── NoteEditor.cpp │ ├── NoteEditor.h │ ├── NoteTitleLineEdit.cpp │ └── NoteTitleLineEdit.h ├── wxNote_List │ ├── NoteList.cpp │ └── NoteList.h ├── wxNote_Other │ ├── FontComboBox.cpp │ ├── FontComboBox.h │ ├── FontSizeComboBox.cpp │ ├── FontSizeComboBox.h │ ├── NoteEditorSplitter.cpp │ ├── NoteEditorSplitter.h │ ├── SearchPanel.cpp │ └── SearchPanel.h ├── wxNote_Tree │ ├── CategoriesTree.cpp │ ├── CategoriesTree.h │ ├── NoteBookTree.cpp │ └── NoteBookTree.h └── wxNote_Window │ ├── AbstractMainWindow.cpp │ ├── AbstractMainWindow.h │ ├── FinalTabWindow.cpp │ ├── FinalTabWindow.h │ ├── MainWindowNormal.cpp │ ├── MainWindowNormal.h │ ├── MainWindowShadow.cpp │ ├── MainWindowShadow.h │ ├── TextEditorWindow.cpp │ └── TextEditorWindow.h ├── wxNote_Icons ├── allNotes.png ├── average-mini.png ├── average.png ├── backSpace.png ├── beginSearch.png ├── bold.png ├── checkBox.png ├── colorLabel.png ├── eliminate.png ├── error.png ├── excellent-mini.png ├── excellent.png ├── fair-mini.png ├── fair.png ├── format-justify-center.png ├── format-justify-fill.png ├── format-justify-left.png ├── format-justify-right.png ├── good-mini.png ├── good.png ├── help.png ├── important-mini.png ├── important.png ├── insertTable.png ├── italic.png ├── label.png ├── later-mini.png ├── later.png ├── locking-mini.png ├── locking.png ├── logoOnAbout.png ├── newNote.png ├── nonCategories-mini.png ├── nonCategories.png ├── nonRating.png ├── noteBook.png ├── notlock.png ├── oneKeyLock.png ├── options.png ├── orderedList.png ├── passwordWrong.png ├── personal-mini.png ├── personal.png ├── poor-mini.png ├── poor.png ├── property.png ├── rating.png ├── reportbug.png ├── restore.png ├── selectColor.png ├── selectFont.png ├── share.png ├── stopSearch.png ├── synchronous.png ├── synchronousFailed.png ├── toDo-mini.png ├── toDo.png ├── trash.png ├── underline.png ├── unorderedList.png ├── work-mini.png ├── work.png ├── wrongful.png ├── wxNote.ico └── wxNoteicon.png └── wxNote_Item ├── NoteListItem.cpp └── NoteListItem.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Window/FinalTabWindow.h" 35 | 36 | #include 37 | #include 38 | 39 | int main(int _Argc, char* *_Argv) 40 | { 41 | QApplication _wxNote(_Argc, _Argv); 42 | 43 | QTextCodec* _Codec = QTextCodec::codecForLocale(); 44 | 45 | QTextCodec::setCodecForLocale(_Codec); 46 | 47 | #if QT_VERSION < 0x050001 48 | QTextCodec::setCodecForCStrings(_Codec); 49 | QTextCodec::setCodecForTr(_Codec); 50 | #endif 51 | 52 | _FinalTabWindow* _wxNote_MainWindow = new _FinalTabWindow; 53 | _wxNote_MainWindow->show(); 54 | # 55 | return _wxNote.exec(); 56 | } 57 | 58 | //////////////////////////////////////////////////////////////////////////// 59 | 60 | /*************************************************************************** 61 | ** ** 62 | ** _________ _______ ** 63 | ** |___ ___| / ______ \ ** 64 | ** | | _______ _______ _______ | / |_| ** 65 | ** | | || || || || || || | | _ __ ** 66 | ** | | || || || || || || | | |__ \ ** 67 | ** | | || || || || || || | \_ _ __| | _ ** 68 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 69 | ** || ** 70 | ** ||_____|| ** 71 | ** ** 72 | ***************************************************************************/ 73 | ///:~ 74 | -------------------------------------------------------------------------------- /rc.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON "wxNote_Icons/wxNote.ico" 2 | -------------------------------------------------------------------------------- /resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | wxNote_Icons/allNotes.png 4 | wxNote_Icons/average.png 5 | wxNote_Icons/average-mini.png 6 | wxNote_Icons/backSpace.png 7 | wxNote_Icons/beginSearch.png 8 | wxNote_Icons/bold.png 9 | wxNote_Icons/checkBox.png 10 | wxNote_Icons/colorLabel.png 11 | wxNote_Icons/eliminate.png 12 | wxNote_Icons/error.png 13 | wxNote_Icons/excellent.png 14 | wxNote_Icons/excellent-mini.png 15 | wxNote_Icons/fair.png 16 | wxNote_Icons/fair-mini.png 17 | wxNote_Icons/format-justify-center.png 18 | wxNote_Icons/format-justify-fill.png 19 | wxNote_Icons/format-justify-left.png 20 | wxNote_Icons/format-justify-right.png 21 | wxNote_Icons/good.png 22 | wxNote_Icons/good-mini.png 23 | wxNote_Icons/help.png 24 | wxNote_Icons/important.png 25 | wxNote_Icons/important-mini.png 26 | wxNote_Icons/insertTable.png 27 | wxNote_Icons/italic.png 28 | wxNote_Icons/label.png 29 | wxNote_Icons/later.png 30 | wxNote_Icons/later-mini.png 31 | wxNote_Icons/locking.png 32 | wxNote_Icons/locking-mini.png 33 | wxNote_Icons/logoOnAbout.png 34 | wxNote_Icons/newNote.png 35 | wxNote_Icons/nonCategories.png 36 | wxNote_Icons/nonCategories-mini.png 37 | wxNote_Icons/nonRating.png 38 | wxNote_Icons/noteBook.png 39 | wxNote_Icons/notlock.png 40 | wxNote_Icons/oneKeyLock.png 41 | wxNote_Icons/options.png 42 | wxNote_Icons/orderedList.png 43 | wxNote_Icons/passwordWrong.png 44 | wxNote_Icons/personal.png 45 | wxNote_Icons/personal-mini.png 46 | wxNote_Icons/poor.png 47 | wxNote_Icons/poor-mini.png 48 | wxNote_Icons/property.png 49 | wxNote_Icons/rating.png 50 | wxNote_Icons/reportbug.png 51 | wxNote_Icons/restore.png 52 | wxNote_Icons/selectColor.png 53 | wxNote_Icons/selectFont.png 54 | wxNote_Icons/share.png 55 | wxNote_Icons/stopSearch.png 56 | wxNote_Icons/synchronous.png 57 | wxNote_Icons/synchronousFailed.png 58 | wxNote_Icons/toDo.png 59 | wxNote_Icons/toDo-mini.png 60 | wxNote_Icons/trash.png 61 | wxNote_Icons/underline.png 62 | wxNote_Icons/unorderedList.png 63 | wxNote_Icons/work.png 64 | wxNote_Icons/work-mini.png 65 | wxNote_Icons/wxNote.ico 66 | wxNote_Icons/wxNoteicon.png 67 | wxNote_Icons/wrongful.png 68 | 69 | 70 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/EliminateOrRestorePushButton.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Button/EliminateOrRestorePushButton.h" 35 | 36 | #include 37 | 38 | //.._EliminateOrRestorePushButton类实现 */ 39 | 40 | /* 构造函数实现 */ 41 | _EliminateOrRestorePushButton 42 | ::_EliminateOrRestorePushButton(QWidget *_Parent) 43 | : QPushButton(_Parent) 44 | { 45 | setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 46 | } 47 | 48 | ///////////////////////////////////////////////////////////////////////// 49 | //..protected部分 50 | 51 | /* sizeHint()函数重写 */ 52 | QSize _EliminateOrRestorePushButton::sizeHint() const 53 | { 54 | QSize _CurrentSize = QPushButton::sizeHint(); 55 | _CurrentSize.rheight() += 10; 56 | 57 | return _CurrentSize; 58 | } 59 | 60 | //////////////////////////////////////////////////////////////////////////// 61 | 62 | /*************************************************************************** 63 | ** ** 64 | ** _________ _______ ** 65 | ** |___ ___| / ______ \ ** 66 | ** | | _______ _______ _______ | / |_| ** 67 | ** | | || || || || || || | | _ __ ** 68 | ** | | || || || || || || | | |__ \ ** 69 | ** | | || || || || || || | \_ _ __| | _ ** 70 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 71 | ** || ** 72 | ** ||_____|| ** 73 | ** ** 74 | ***************************************************************************/ 75 | ///:~ 76 | 77 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/EliminateOrRestorePushButton.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _EliminateOrRestorePushButton : public QPushButton 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _EliminateOrRestorePushButton(QWidget* _Parent = nullptr); 43 | 44 | protected: 45 | QSize sizeHint() const; 46 | }; 47 | 48 | //////////////////////////////////////////////////////////////////////////// 49 | 50 | /*************************************************************************** 51 | ** ** 52 | ** _________ _______ ** 53 | ** |___ ___| / ______ \ ** 54 | ** | | _______ _______ _______ | / |_| ** 55 | ** | | || || || || || || | | _ __ ** 56 | ** | | || || || || || || | | |__ \ ** 57 | ** | | || || || || || || | \_ _ __| | _ ** 58 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 59 | ** || ** 60 | ** ||_____|| ** 61 | ** ** 62 | ***************************************************************************/ 63 | ///:~ 64 | 65 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/NestingButton.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Button/NestingButton.h" 35 | 36 | #include 37 | #include 38 | 39 | //.._NestingButton类实现 40 | 41 | /* 构造函数实现 */ 42 | _NestingButton::_NestingButton(const QIcon &_Icon, QLineEdit *_LineEdit) 43 | { 44 | QSize _Size(_LineEdit->sizeHint().height(), 45 | _LineEdit->sizeHint().height()); 46 | 47 | setMinimumSize(_Size); 48 | setMaximumSize(_Size); 49 | 50 | setFocusPolicy(Qt::NoFocus); 51 | setCursor(QCursor(Qt::ArrowCursor)); 52 | setFlat(true); 53 | 54 | setIcon(_Icon); 55 | 56 | QHBoxLayout* _ButtonLayout = new QHBoxLayout; 57 | _ButtonLayout->setContentsMargins(0, 0, 0, 0); 58 | _ButtonLayout->addStretch(); 59 | _ButtonLayout->addWidget(this); 60 | 61 | _LineEdit->setLayout(_ButtonLayout); 62 | _LineEdit->setTextMargins(0, 1, _Size.width(), 1); 63 | } 64 | 65 | //////////////////////////////////////////////////////////////////////////// 66 | 67 | /*************************************************************************** 68 | ** ** 69 | ** _________ _______ ** 70 | ** |___ ___| / ______ \ ** 71 | ** | | _______ _______ _______ | / |_| ** 72 | ** | | || || || || || || | | _ __ ** 73 | ** | | || || || || || || | | |__ \ ** 74 | ** | | || || || || || || | \_ _ __| | _ ** 75 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 76 | ** || ** 77 | ** ||_____|| ** 78 | ** ** 79 | ***************************************************************************/ 80 | ///:~ 81 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/NestingButton.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QLineEdit; 38 | 39 | class _NestingButton : public QPushButton 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | _NestingButton(const QIcon& _Icon, QLineEdit* _LineEdit); 45 | }; 46 | 47 | //////////////////////////////////////////////////////////////////////////// 48 | 49 | /*************************************************************************** 50 | ** ** 51 | ** _________ _______ ** 52 | ** |___ ___| / ______ \ ** 53 | ** | | _______ _______ _______ | / |_| ** 54 | ** | | || || || || || || | | _ __ ** 55 | ** | | || || || || || || | | |__ \ ** 56 | ** | | || || || || || || | \_ _ __| | _ ** 57 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 58 | ** || ** 59 | ** ||_____|| ** 60 | ** ** 61 | ***************************************************************************/ 62 | ///:~ 63 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/wxNote_ToolButton.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Button/wxNote_ToolButton.h" 35 | 36 | //.._wxNote_ToolButton类实现 37 | 38 | /* 构造函数实现 */ 39 | _wxNote_ToolButton::_wxNote_ToolButton(QWidget *_Parent) 40 | : QToolButton(_Parent) 41 | { 42 | setAutoRaise(true); 43 | setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 44 | } 45 | 46 | //////////////////////////////////////////////////////////////////////////// 47 | 48 | /*************************************************************************** 49 | ** ** 50 | ** _________ _______ ** 51 | ** |___ ___| / ______ \ ** 52 | ** | | _______ _______ _______ | / |_| ** 53 | ** | | || || || || || || | | _ __ ** 54 | ** | | || || || || || || | | |__ \ ** 55 | ** | | || || || || || || | \_ _ __| | _ ** 56 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 57 | ** || ** 58 | ** ||_____|| ** 59 | ** ** 60 | ***************************************************************************/ 61 | ///:~ 62 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Button/wxNote_ToolButton.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _wxNote_ToolButton : public QToolButton 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _wxNote_ToolButton(QWidget* _Parent = nullptr); 43 | }; 44 | 45 | //////////////////////////////////////////////////////////////////////////// 46 | 47 | /*************************************************************************** 48 | ** ** 49 | ** _________ _______ ** 50 | ** |___ ___| / ______ \ ** 51 | ** | | _______ _______ _______ | / |_| ** 52 | ** | | || || || || || || | | _ __ ** 53 | ** | | || || || || || || | | |__ \ ** 54 | ** | | || || || || || || | \_ _ __| | _ ** 55 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 56 | ** || ** 57 | ** ||_____|| ** 58 | ** ** 59 | ***************************************************************************/ 60 | ///:~ 61 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/AboutDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QTabWidget; 38 | class QLabel; 39 | class QPushButton; 40 | class QTextBrowser; 41 | class QWidget; 42 | 43 | class _AboutwxNote : public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | _AboutwxNote(QWidget* _Parent = nullptr); 49 | 50 | QTabWidget* _GetTabWidget() const { return m_TabWidgetOnDialog; } 51 | 52 | protected: 53 | void _CreateNormalPage(); 54 | void _CreateVersionPage(); 55 | void _CreateLicensePage(); 56 | void _Create2UserPage(); 57 | 58 | QLabel* m_LogoLabel; 59 | QTabWidget* m_TabWidgetOnDialog; 60 | QPushButton* m_OKButton; 61 | 62 | QWidget* m_NormalPage; 63 | QWidget* m_VersionPage; 64 | QWidget* m_LicensePage; 65 | QWidget* m_2UserPage; 66 | 67 | QTextBrowser* m_NormalTextBrowser; 68 | QTextBrowser* m_VersionPageBrowser; 69 | QTextBrowser* m_LicenseTextBrowser; 70 | QTextBrowser* m_2UserTextBrowser; 71 | }; 72 | 73 | //////////////////////////////////////////////////////////////////////////// 74 | 75 | /*************************************************************************** 76 | ** ** 77 | ** _________ _______ ** 78 | ** |___ ___| / ______ \ ** 79 | ** | | _______ _______ _______ | / |_| ** 80 | ** | | || || || || || || | | _ __ ** 81 | ** | | || || || || || || | | |__ \ ** 82 | ** | | || || || || || || | \_ _ __| | _ ** 83 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 84 | ** || ** 85 | ** ||_____|| ** 86 | ** ** 87 | ***************************************************************************/ 88 | ///:~ 89 | 90 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/CommonDialog.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Dialog/CommonDialog.h" 35 | 36 | #include "wxNote_Global.h" 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | //.._CommonDialog类实现 44 | 45 | /* 构造函数实现 */ 46 | _CommonDialog::_CommonDialog(QWidget *_Parent, 47 | const QString &_Title, 48 | const QString &_Label, 49 | const QString &_OKButtonName, 50 | const QString &_CancelButtonName) 51 | : QDialog(_Parent, Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint) 52 | { 53 | m_LogoLabel = new QLabel(""); 54 | m_QuestionLabel = new QLabel(_Label); 55 | 56 | m_OKButton = new QPushButton(_OKButtonName); 57 | m_CancelButton = new QPushButton(_CancelButtonName); 58 | 59 | connect(m_OKButton, SIGNAL(clicked()), this, SLOT(accept())); 60 | connect(m_CancelButton, SIGNAL(clicked()), this, SLOT(reject())); 61 | 62 | QHBoxLayout* _BottomLayout = new QHBoxLayout; 63 | _BottomLayout->addStretch(); 64 | _BottomLayout->addWidget(m_OKButton); 65 | 66 | if (!_CancelButtonName.isEmpty() /* 如果用户没有指定Cancel按钮的名称... */) 67 | /* 代表用户不想要这个按钮在对话框中显示出来 */ 68 | _BottomLayout->addWidget(m_CancelButton); 69 | 70 | QVBoxLayout* _RightLayout = new QVBoxLayout; 71 | _RightLayout->addWidget(m_QuestionLabel); 72 | _RightLayout->addLayout(_BottomLayout); 73 | 74 | QHBoxLayout* _MainLayout = new QHBoxLayout; 75 | _MainLayout->addWidget(m_LogoLabel); 76 | _MainLayout->addLayout(_RightLayout); 77 | 78 | setLayout(_MainLayout); 79 | setFixedSize(sizeHint()); 80 | setWindowTitle(_Title); 81 | setFont(wxNote::g_StandardFont); 82 | setWindowIcon(QIcon(":/wxNote_Icons/wxNoteicon.png")); 83 | } 84 | 85 | //////////////////////////////////////////////////////////////////////////// 86 | 87 | /*************************************************************************** 88 | ** ** 89 | ** _________ _______ ** 90 | ** |___ ___| / ______ \ ** 91 | ** | | _______ _______ _______ | / |_| ** 92 | ** | | || || || || || || | | _ __ ** 93 | ** | | || || || || || || | | |__ \ ** 94 | ** | | || || || || || || | \_ _ __| | _ ** 95 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 96 | ** || ** 97 | ** ||_____|| ** 98 | ** ** 99 | ***************************************************************************/ 100 | ///:~ 101 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/CommonDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QLabel; 38 | class QPushButton; 39 | 40 | /* 该类定义了一个在用户点击"彻底删除当前笔记"按钮时会弹出的一个对话框 41 | * 用于确认用户的删除意图, 防止误删 42 | */ 43 | class _CommonDialog : public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | _CommonDialog(QWidget* _Parent, 49 | const QString& _Title, 50 | const QString& _Label, 51 | const QString& _OKButtonName, 52 | const QString& _CancelButtonName = ""); 53 | protected: 54 | QLabel* m_LogoLabel; 55 | QLabel* m_QuestionLabel; 56 | 57 | QPushButton* m_OKButton; 58 | QPushButton* m_CancelButton; 59 | }; 60 | 61 | //////////////////////////////////////////////////////////////////////////// 62 | 63 | /*************************************************************************** 64 | ** ** 65 | ** _________ _______ ** 66 | ** |___ ___| / ______ \ ** 67 | ** | | _______ _______ _______ | / |_| ** 68 | ** | | || || || || || || | | _ __ ** 69 | ** | | || || || || || || | | |__ \ ** 70 | ** | | || || || || || || | \_ _ __| | _ ** 71 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 72 | ** || ** 73 | ** ||_____|| ** 74 | ** ** 75 | ***************************************************************************/ 76 | ///:~ 77 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/GetNameForNewNotebook.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Dialog/GetNameForNewNotebook.h" 35 | #include "wxNote_Gui/wxNote_Button/NestingButton.h" 36 | 37 | #include "wxNote_Global.h" 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | //.._GetNameForNewNoteBook类实现 47 | 48 | /* 构造函数实现 */ 49 | _GetNameForNewNoteBookDialog 50 | ::_GetNameForNewNoteBookDialog(QWidget *_Parent) 51 | : QDialog(_Parent, Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint) 52 | { 53 | m_NameLabel = new QLabel(tr("笔记本名称(&N):")); 54 | m_NameLineEdit = new QLineEdit; 55 | m_NameLineEdit->setMaxLength(40); 56 | m_NameLabel->setBuddy(m_NameLineEdit); 57 | 58 | m_BackSpaceToolButton = new _NestingButton(QIcon(":/wxNote_Icons/backSpace.png"), 59 | m_NameLineEdit); 60 | 61 | m_BackSpaceToolButton->setFixedSize(m_NameLineEdit->sizeHint().height() + 5, 62 | m_NameLineEdit->sizeHint().height()); 63 | 64 | connect(m_NameLineEdit, SIGNAL(textChanged(QString)), 65 | this, SLOT(_LineEditTextChanged(QString))); 66 | connect(m_BackSpaceToolButton, SIGNAL(clicked()), 67 | this, SLOT(_LineEditBackSpace())); 68 | 69 | m_WaringLabel = new QLabel(tr("" 70 | "\t笔记本名不能包含下列任何字符:" 71 | "

如 \\ / : * ? " < > | ~" 72 | "
记事本开头不能为.")); 73 | m_WaringLabel->setHidden(true); 74 | 75 | m_ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok 76 | | QDialogButtonBox::Cancel); 77 | 78 | QPushButton* _OKButton = 79 | m_ButtonBox->button(QDialogButtonBox::Ok); 80 | _OKButton->setText(tr("创建")); 81 | _OKButton->setDefault(true); 82 | _OKButton->setEnabled(false); 83 | 84 | QPushButton* _CancelButton = 85 | m_ButtonBox->button(QDialogButtonBox::Cancel); 86 | _CancelButton->setText(tr("取消")); 87 | 88 | connect(m_ButtonBox, SIGNAL(accepted()), this, SLOT(accept())); 89 | connect(m_ButtonBox, SIGNAL(rejected()), this, SLOT(reject())); 90 | 91 | QVBoxLayout* _MainLayout = new QVBoxLayout; 92 | _MainLayout->addWidget(m_NameLabel); 93 | _MainLayout->addWidget(m_NameLineEdit); 94 | _MainLayout->addWidget(m_WaringLabel); 95 | _MainLayout->addStretch(); 96 | _MainLayout->addWidget(m_ButtonBox); 97 | 98 | setLayout(_MainLayout); 99 | setFixedSize(250, sizeHint().height() + 80); 100 | setWindowTitle(tr("新建笔记本")); 101 | setFont(wxNote::g_StandardFont); 102 | setWindowIcon(QIcon(":/wxNote_Icons/wxNoteicon.png")); 103 | } 104 | 105 | /* _GetLineEditText()函数实现 */ 106 | QString _GetNameForNewNoteBookDialog::_GetLineEditText() const 107 | { 108 | return m_NameLineEdit->text(); 109 | } 110 | 111 | ///////////////////////////////////////////////////////////////////////// 112 | //..protected部分 113 | 114 | /* _LineEditTextChanged()槽实现 */ 115 | void _GetNameForNewNoteBookDialog 116 | ::_LineEditTextChanged(const QString &_CurrentText) 117 | { 118 | bool _ContainsWrongful( 119 | _CurrentText.contains('\\') || _CurrentText.contains('/') 120 | || _CurrentText.contains(':') || _CurrentText.contains('*') 121 | || _CurrentText.contains('?') || _CurrentText.contains('"') 122 | || _CurrentText.contains('<') || _CurrentText.contains('>') 123 | || _CurrentText.contains('|') || _CurrentText.contains('~') 124 | || (_CurrentText.indexOf('.') == 0)); 125 | 126 | m_WaringLabel->setHidden(!_ContainsWrongful); 127 | 128 | m_ButtonBox->button(QDialogButtonBox::Ok) 129 | ->setEnabled(!_CurrentText.isEmpty() && !_ContainsWrongful); 130 | } 131 | 132 | /* _LineEditBackSpace()槽实现 */ 133 | void _GetNameForNewNoteBookDialog::_LineEditBackSpace() 134 | { 135 | m_NameLineEdit->backspace(); 136 | } 137 | 138 | //////////////////////////////////////////////////////////////////////////// 139 | 140 | /*************************************************************************** 141 | ** ** 142 | ** _________ _______ ** 143 | ** |___ ___| / ______ \ ** 144 | ** | | _______ _______ _______ | / |_| ** 145 | ** | | || || || || || || | | _ __ ** 146 | ** | | || || || || || || | | |__ \ ** 147 | ** | | || || || || || || | \_ _ __| | _ ** 148 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 149 | ** || ** 150 | ** ||_____|| ** 151 | ** ** 152 | ***************************************************************************/ 153 | ///:~ 154 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/GetNameForNewNotebook.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _NestingButton; 38 | 39 | class QLabel; 40 | class QLineEdit; 41 | class QDialogButtonBox; 42 | 43 | class _GetNameForNewNoteBookDialog : public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | _GetNameForNewNoteBookDialog(QWidget* _Parent = nullptr); 49 | 50 | QString _GetLineEditText() const; 51 | 52 | protected slots: 53 | void _LineEditTextChanged(const QString& _CurrentText); 54 | void _LineEditBackSpace(); 55 | 56 | protected: 57 | QLabel* m_NameLabel; 58 | QLineEdit* m_NameLineEdit; 59 | 60 | _NestingButton* m_BackSpaceToolButton; 61 | 62 | QLabel* m_WaringLabel; 63 | 64 | QDialogButtonBox* m_ButtonBox; 65 | }; 66 | 67 | //////////////////////////////////////////////////////////////////////////// 68 | 69 | /*************************************************************************** 70 | ** ** 71 | ** _________ _______ ** 72 | ** |___ ___| / ______ \ ** 73 | ** | | _______ _______ _______ | / |_| ** 74 | ** | | || || || || || || | | _ __ ** 75 | ** | | || || || || || || | | |__ \ ** 76 | ** | | || || || || || || | \_ _ __| | _ ** 77 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 78 | ** || ** 79 | ** ||_____|| ** 80 | ** ** 81 | ***************************************************************************/ 82 | ///:~ 83 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/GetPasswordDialog.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Dialog/GetPasswordDialog.h" 35 | #include "wxNote_Gui/wxNote_Dialog/CommonDialog.h" 36 | 37 | #include "wxNote_Global.h" 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | //.._GetPasswordDialog类实现 50 | 51 | /* 构造函数实现 */ 52 | _GetPasswordDialog::_GetPasswordDialog(QWidget *_Parent) 53 | : QDialog(_Parent, Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint) 54 | { 55 | m_GetPasswordLabel = new QLabel(tr("请输入解锁密码(&I):")); 56 | 57 | m_UnlockFailedLabel = new QLabel("" 58 | "\t解锁失败!键入的密码不正确。"); 59 | m_UnlockFailedLabel->setHidden(true); 60 | 61 | QRegExp _PasswordFormat("[A-Za-z0-9,./?_!@#$%^&*()-+=~`]{0,16}"); 62 | 63 | m_GetPasswordLineEdit = new QLineEdit; 64 | m_GetPasswordLineEdit->setValidator(new QRegExpValidator(_PasswordFormat, this)); 65 | m_GetPasswordLineEdit->setEchoMode(QLineEdit::Password); 66 | m_GetPasswordLabel->setBuddy(m_GetPasswordLineEdit); 67 | 68 | m_VisiblePasswordCheckBox = new QCheckBox(tr("显示密码(&V)")); 69 | connect(m_VisiblePasswordCheckBox, SIGNAL(toggled(bool)), 70 | this, SLOT(_VisiblePasswordChangeSlot(bool))); 71 | 72 | m_ButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok 73 | | QDialogButtonBox::Cancel); 74 | m_ButtonBox->button(QDialogButtonBox::Ok)->setText(tr("好的")); 75 | 76 | m_ButtonBox->button(QDialogButtonBox::Cancel)->setText(tr("离开")); 77 | 78 | connect(m_ButtonBox, SIGNAL(accepted()), this, SLOT(_ValidatePassword())); 79 | connect(m_ButtonBox, SIGNAL(rejected()), this, SLOT(reject())); 80 | 81 | QHBoxLayout* _CheckBoxLayout = new QHBoxLayout; 82 | _CheckBoxLayout->addStretch(); 83 | _CheckBoxLayout->addWidget(m_VisiblePasswordCheckBox); 84 | 85 | QVBoxLayout* _MainLayout = new QVBoxLayout; 86 | _MainLayout->addWidget(m_GetPasswordLabel); 87 | _MainLayout->addWidget(m_GetPasswordLineEdit); 88 | _MainLayout->addWidget(m_UnlockFailedLabel); 89 | _MainLayout->addLayout(_CheckBoxLayout); 90 | _MainLayout->addStretch(); 91 | _MainLayout->addWidget(m_ButtonBox); 92 | 93 | setLayout(_MainLayout); 94 | setWindowTitle(tr("笔记解锁")); 95 | setWindowIcon(QIcon(":/wxNote_Icons/notlock.png")); 96 | setFont(wxNote::g_StandardFont); 97 | setFixedSize(QSize(sizeHint().width() + 72, 155)); 98 | } 99 | 100 | ///////////////////////////////////////////////////////////////////////// 101 | //..protected部分 102 | 103 | /* _CheckPasswordWhenClickedOkSlot()槽实现 */ 104 | void _GetPasswordDialog::_VisiblePasswordChangeSlot(bool _IsVisibled) 105 | { 106 | m_GetPasswordLineEdit->setEchoMode(_IsVisibled ? QLineEdit::Normal 107 | : QLineEdit::Password); 108 | } 109 | 110 | /* _ValidatePassword()槽实现 */ 111 | void _GetPasswordDialog::_ValidatePassword() 112 | { 113 | using namespace wxNote; 114 | 115 | g_Settings.beginGroup("TextEditor"); 116 | QString _Password = g_Settings.value("NotePassWord").toString(); 117 | g_Settings.endGroup(); 118 | 119 | if (m_GetPasswordLineEdit->text() == _Password) 120 | accept(); 121 | else 122 | _SetFailedUnlockLabelHidden(false); 123 | } 124 | 125 | //////////////////////////////////////////////////////////////////////////// 126 | 127 | /*************************************************************************** 128 | ** ** 129 | ** _________ _______ ** 130 | ** |___ ___| / ______ \ ** 131 | ** | | _______ _______ _______ | / |_| ** 132 | ** | | || || || || || || | | _ __ ** 133 | ** | | || || || || || || | | |__ \ ** 134 | ** | | || || || || || || | \_ _ __| | _ ** 135 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 136 | ** || ** 137 | ** ||_____|| ** 138 | ** ** 139 | ***************************************************************************/ 140 | ///:~ 141 | 142 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/GetPasswordDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | #include 37 | 38 | class QLabel; 39 | class QLineEdit; 40 | class QPushButton; 41 | class QCheckBox; 42 | class QDialogButtonBox; 43 | 44 | class _GetPasswordDialog : public QDialog 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | _GetPasswordDialog(QWidget* _Parent = nullptr); 50 | 51 | QLineEdit* _GetLineEdit() const 52 | { return m_GetPasswordLineEdit; } 53 | 54 | void _SetFailedUnlockLabelHidden(bool _IsOK) 55 | { m_UnlockFailedLabel->setHidden(_IsOK); } 56 | 57 | protected slots: 58 | void _VisiblePasswordChangeSlot(bool _IsVisibled); 59 | 60 | void _ValidatePassword(); 61 | 62 | protected: 63 | QLabel* m_GetPasswordLabel; 64 | QLabel* m_UnlockFailedLabel; 65 | QLineEdit* m_GetPasswordLineEdit; 66 | 67 | QCheckBox* m_VisiblePasswordCheckBox; 68 | 69 | QDialogButtonBox* m_ButtonBox; 70 | }; 71 | 72 | //////////////////////////////////////////////////////////////////////////// 73 | 74 | /*************************************************************************** 75 | ** ** 76 | ** _________ _______ ** 77 | ** |___ ___| / ______ \ ** 78 | ** | | _______ _______ _______ | / |_| ** 79 | ** | | || || || || || || | | _ __ ** 80 | ** | | || || || || || || | | |__ \ ** 81 | ** | | || || || || || || | \_ _ __| | _ ** 82 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 83 | ** || ** 84 | ** ||_____|| ** 85 | ** ** 86 | ***************************************************************************/ 87 | ///:~ 88 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/InsertTableDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QLabel; 38 | class QSpinBox; 39 | class QDialogButtonBox; 40 | class QGroupBox; 41 | class QComboBox; 42 | class QGridLayout; 43 | 44 | class _InsertTableDialog : public QDialog 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | _InsertTableDialog(QWidget* _Parent = nullptr); 50 | 51 | int _GetRowCnt() const 52 | { return m_RowCnt; } 53 | int _GetColumnCnt() const 54 | { return m_ColumnCnt; } 55 | int _GetTableWidth() const 56 | { return m_TableWidth; } 57 | 58 | protected slots: 59 | void _RowCntSpinBoxValChanged(int _NewVal); 60 | void _ColumnCntSpinBoxValChanged(int _NewVal); 61 | void _TableWidthSpinBoxValChanged(int _NewVal); 62 | 63 | void _SetOKButtonEnabled(); 64 | 65 | protected: 66 | void _CreateWidgetsInGroupBox(); 67 | void _CreateSizeGroupBox(); 68 | 69 | QLabel* m_RowCountLabel; 70 | QLabel* m_ColumnCountLabel; 71 | QLabel* m_TableWidthLabel; 72 | 73 | QSpinBox* m_RowCountSpinBox; 74 | QSpinBox* m_ColumnCountSpinBox; 75 | QSpinBox* m_TableWidthSpinBox; 76 | 77 | QComboBox* m_SymbolComboBox; 78 | 79 | QGroupBox* m_TableSizeGroupBox; 80 | QGridLayout* m_MainGridLayout; 81 | 82 | QDialogButtonBox* m_ButtonBox; 83 | 84 | int m_RowCnt; 85 | int m_ColumnCnt; 86 | int m_TableWidth; 87 | }; 88 | 89 | //////////////////////////////////////////////////////////////////////////// 90 | 91 | /*************************************************************************** 92 | ** ** 93 | ** _________ _______ ** 94 | ** |___ ___| / ______ \ ** 95 | ** | | _______ _______ _______ | / |_| ** 96 | ** | | || || || || || || | | _ __ ** 97 | ** | | || || || || || || | | |__ \ ** 98 | ** | | || || || || || || | \_ _ __| | _ ** 99 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 100 | ** || ** 101 | ** ||_____|| ** 102 | ** ** 103 | ***************************************************************************/ 104 | ///:~ 105 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/OptionsDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QLineEdit; 38 | class QTabWidget; 39 | class QLabel; 40 | class QGroupBox; 41 | class QHBoxLayout; 42 | class QVBoxLayout; 43 | class QGridLayout; 44 | class QCheckBox; 45 | class QDialogButtonBox; 46 | 47 | class _FontComboBox; 48 | class _FontSizeComboBox; 49 | 50 | class _OptionsDialog : public QDialog 51 | { 52 | Q_OBJECT 53 | 54 | public: 55 | _OptionsDialog(QWidget* _Parent = nullptr); 56 | 57 | QLineEdit* _GetLocalFilePathLineEdit() const 58 | { return m_LocalFilePathLineEdit; } 59 | 60 | _FontComboBox* _GetFontComboBox() const 61 | { return m_FontComboBox; } 62 | _FontSizeComboBox* _GetFontSizeComboBox() const 63 | { return m_FontSizeComboBox; } 64 | QCheckBox* _GetAcceptRichTextCheckBox() const 65 | { return m_AcceptRichTextCheckBox; } 66 | bool _GetIsChanged() const 67 | { return mb_IsChanged; } 68 | 69 | protected slots: 70 | void _SetCurrentSettingsChanged(); 71 | 72 | void _ChangeLocalFilePathSlot(); 73 | 74 | protected: 75 | enum { _FontMinSize = 8, _FontMaxSize = 96 }; 76 | 77 | void _CreateCommonOptionPage(); 78 | void _CreateNoteOptionsPage(); 79 | 80 | QTabWidget* m_TabWidgetOnDialog; 81 | QDialogButtonBox* m_ButtonBox; 82 | 83 | bool mb_IsChanged; 84 | 85 | /* "通用"选项 */ 86 | QWidget* m_CommonOptionPage; 87 | 88 | QGroupBox* m_LocalFileGroupBox; 89 | QLineEdit* m_LocalFilePathLineEdit; 90 | QPushButton* m_ChangePathPushButton; 91 | 92 | QHBoxLayout* m_EditLocalFilePathLayout; 93 | QVBoxLayout* m_LocalFileLayout; 94 | 95 | /* "笔记"选项 */ 96 | QWidget* m_NoteOptionPage; 97 | 98 | QLabel* m_NoteEditorFontLabel; 99 | 100 | _FontComboBox* m_FontComboBox; 101 | _FontSizeComboBox* m_FontSizeComboBox; 102 | 103 | QGroupBox* m_FontGroupBox; 104 | QHBoxLayout* m_ComboBoxLayout; 105 | QVBoxLayout* m_FontLayout; 106 | 107 | QCheckBox* m_AcceptRichTextCheckBox; 108 | QGroupBox* m_AcceptGroupBox; 109 | QVBoxLayout* m_AcceptLayout; 110 | }; 111 | 112 | //////////////////////////////////////////////////////////////////////////// 113 | 114 | /*************************************************************************** 115 | ** ** 116 | ** _________ _______ ** 117 | ** |___ ___| / ______ \ ** 118 | ** | | _______ _______ _______ | / |_| ** 119 | ** | | || || || || || || | | _ __ ** 120 | ** | | || || || || || || | | |__ \ ** 121 | ** | | || || || || || || | \_ _ __| | _ ** 122 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 123 | ** || ** 124 | ** ||_____|| ** 125 | ** ** 126 | ***************************************************************************/ 127 | ///:~ 128 | 129 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Dialog/SetPasswordDialog.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QLabel; 38 | class QLineEdit; 39 | class QDialogButtonBox; 40 | class QCheckBox; 41 | 42 | /* 该对话框用于当用户锁定某个笔记时向用户请求设置密码 */ 43 | class _SetPasswordDialog : public QDialog 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | _SetPasswordDialog(QWidget* _Parent = nullptr); 49 | 50 | protected slots: 51 | void _CheckPasswordWhenClickedOkSlot(); 52 | void _VisiblePasswordChangeSlot(bool _IsVisibled); 53 | void _ConfirmLineEditEnabled(QString _Text); 54 | 55 | protected: 56 | QLabel* m_SetPasswordLabel; 57 | QLineEdit* m_SetPasswordLineEdit; 58 | 59 | QLabel* m_ConfirmPasswordLabel; 60 | QLineEdit* m_ConfirmPasswordLineEdit; 61 | 62 | QCheckBox* m_VisiblePasswordCheckBox; 63 | 64 | QDialogButtonBox* m_ButtonBox; 65 | }; 66 | 67 | //////////////////////////////////////////////////////////////////////////// 68 | 69 | /*************************************************************************** 70 | ** ** 71 | ** _________ _______ ** 72 | ** |___ ___| / ______ \ ** 73 | ** | | _______ _______ _______ | / |_| ** 74 | ** | | || || || || || || | | _ __ ** 75 | ** | | || || || || || || | | |__ \ ** 76 | ** | | || || || || || || | \_ _ __| | _ ** 77 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 78 | ** || ** 79 | ** ||_____|| ** 80 | ** ** 81 | ***************************************************************************/ 82 | ///:~ 83 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Edit/NoteEditor.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Edit/NoteEditor.h" 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | //.._NoteEditor类实现 41 | 42 | /* 构造函数实现 */ 43 | _NoteEditor::_NoteEditor(QWidget *_Parent) 44 | : QTextEdit(_Parent) 45 | {;} 46 | 47 | ///////////////////////////////////////////////////////////////////////// 48 | //..protected部分 49 | 50 | /* keyPressEvent()事件重写 */ 51 | void _NoteEditor::keyPressEvent(QKeyEvent *_Event) 52 | { 53 | switch (_Event->key()) 54 | { 55 | case Qt::Key_Tab: 56 | if (_Event->modifiers() & Qt::ControlModifier) 57 | { 58 | _FinalTabWindowMove2NextTabSignal(); 59 | break; 60 | } 61 | 62 | default: 63 | QTextEdit::keyPressEvent(_Event); 64 | } 65 | } 66 | 67 | //////////////////////////////////////////////////////////////////////////// 68 | 69 | /*************************************************************************** 70 | ** ** 71 | ** _________ _______ ** 72 | ** |___ ___| / ______ \ ** 73 | ** | | _______ _______ _______ | / |_| ** 74 | ** | | || || || || || || | | _ __ ** 75 | ** | | || || || || || || | | |__ \ ** 76 | ** | | || || || || || || | \_ _ __| | _ ** 77 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 78 | ** || ** 79 | ** ||_____|| ** 80 | ** ** 81 | ***************************************************************************/ 82 | ///:~ 83 | 84 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Edit/NoteEditor.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _NoteEditor : public QTextEdit 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _NoteEditor(QWidget* _Parent = nullptr); 43 | 44 | signals: 45 | void _FinalTabWindowMove2NextTabSignal(); 46 | 47 | protected: 48 | void keyPressEvent(QKeyEvent *_Event); 49 | }; 50 | 51 | //////////////////////////////////////////////////////////////////////////// 52 | 53 | /*************************************************************************** 54 | ** ** 55 | ** _________ _______ ** 56 | ** |___ ___| / ______ \ ** 57 | ** | | _______ _______ _______ | / |_| ** 58 | ** | | || || || || || || | | _ __ ** 59 | ** | | || || || || || || | | |__ \ ** 60 | ** | | || || || || || || | \_ _ __| | _ ** 61 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 62 | ** || ** 63 | ** ||_____|| ** 64 | ** ** 65 | ***************************************************************************/ 66 | ///:~ 67 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Edit/NoteTitleLineEdit.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Edit/NoteTitleLineEdit.h" 35 | 36 | #include 37 | #include 38 | 39 | //.._NoteTitleLineEdit类实现 40 | 41 | /* 构造函数实现 */ 42 | _NoteTitleLineEdit::_NoteTitleLineEdit(QWidget *_Parent) 43 | : QLineEdit(_Parent) 44 | { 45 | m_FontFamily = "微软雅黑,12,-1,5,50,0,0,0,0,0"; 46 | 47 | setStyleSheet("color:darkGray"); 48 | setFont(QFont(m_FontFamily, 15, 15, true)); 49 | setCursorMoveStyle(Qt::LogicalMoveStyle); 50 | setFrame(false); 51 | setPlaceholderText(tr("在此设置标题...")); 52 | 53 | connect(this, SIGNAL(textChanged(QString)), 54 | this, SLOT(_CurrentTextChanged(QString))); 55 | } 56 | 57 | ///////////////////////////////////////////////////////////////////////// 58 | //..protected部分 59 | 60 | /* _SetIsItalic()函数实现 */ 61 | void _NoteTitleLineEdit::_SetIsItalic(bool _IsItaic) 62 | { 63 | setFont(QFont(m_FontFamily, 15, 15, _IsItaic)); 64 | } 65 | 66 | /* _CurrentTextChaned()槽实现 */ 67 | void _NoteTitleLineEdit::_CurrentTextChanged(const QString &_Text) 68 | { 69 | if (!_Text.isEmpty()) 70 | { 71 | /* 如果用户输入了文字, 那么就取消文字的斜体 */ 72 | _SetIsItalic(false); 73 | setStyleSheet("color:rgb(10, 149, 216)"); 74 | } 75 | else 76 | { 77 | _SetIsItalic(true); 78 | setStyleSheet("color:darkGray"); 79 | } 80 | } 81 | 82 | //////////////////////////////////////////////////////////////////////////// 83 | 84 | /*************************************************************************** 85 | ** ** 86 | ** _________ _______ ** 87 | ** |___ ___| / ______ \ ** 88 | ** | | _______ _______ _______ | / |_| ** 89 | ** | | || || || || || || | | _ __ ** 90 | ** | | || || || || || || | | |__ \ ** 91 | ** | | || || || || || || | \_ _ __| | _ ** 92 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 93 | ** || ** 94 | ** ||_____|| ** 95 | ** ** 96 | ***************************************************************************/ 97 | ///:~ 98 | 99 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Edit/NoteTitleLineEdit.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | //..该类定义了一个在编辑窗口中显示的"标题编辑栏" 38 | 39 | class _NoteTitleLineEdit : public QLineEdit 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | _NoteTitleLineEdit(QWidget* _Parent = nullptr); 45 | 46 | protected slots: 47 | void _CurrentTextChanged(const QString& _Text); 48 | 49 | protected: 50 | inline void _SetIsItalic(bool _IsItaic); 51 | 52 | QString m_FontFamily; 53 | }; 54 | 55 | //////////////////////////////////////////////////////////////////////////// 56 | 57 | /*************************************************************************** 58 | ** ** 59 | ** _________ _______ ** 60 | ** |___ ___| / ______ \ ** 61 | ** | | _______ _______ _______ | / |_| ** 62 | ** | | || || || || || || | | _ __ ** 63 | ** | | || || || || || || | | |__ \ ** 64 | ** | | || || || || || || | \_ _ __| | _ ** 65 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 66 | ** || ** 67 | ** ||_____|| ** 68 | ** ** 69 | ***************************************************************************/ 70 | ///:~ 71 | 72 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_List/NoteList.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | #include "wxNote_Item/NoteListItem.h" 38 | 39 | class _NoteListItem; 40 | class _TextEditorWindow; 41 | class _MainWindowShadow; 42 | 43 | class QTabWidget; 44 | 45 | //..该类定义了一个在_MainWindowNormal中显示的笔记列表 46 | class _NoteList : public QListWidget 47 | { 48 | Q_OBJECT 49 | 50 | public: 51 | _NoteList(QWidget* _Parent = nullptr); 52 | 53 | void _AddItem(const QPair<_NoteListItem*, QString> _ItemGroup, 54 | bool _IsRestore = false); 55 | 56 | int _HiddenCount(); 57 | 58 | QModelIndex _GetIndexFromItem(QListWidgetItem* _Item) const; 59 | 60 | _NoteListItem* _GetCurrentItem() const; 61 | _NoteListItem* _Item(int _Index) const; 62 | 63 | QString _GetSpecifiedItemTitle(int _Index); 64 | QString _GetCurrentItemTitle(); 65 | 66 | QList<_NoteListItem *> 67 | _GetNotesInSpecifiedNoteBook(const QString& _CurrentLabelName, 68 | const QTabWidget* wxNote_TabWidget); 69 | QList<_NoteListItem *> 70 | _GetNotesInSpecifiedCategories(const wxNote::_NoteCategories); 71 | QList<_NoteListItem *> 72 | _GetNotesInSpecifiedRating(const wxNote::_NoteRating); 73 | 74 | QList<_NoteListItem *> _GetAllNotes() const; 75 | QList<_NoteListItem *> _GetAllNotes_ExceptTrash() const; 76 | 77 | void _AdjustNoteItemDye(const QString& _CurrentNoteBookName, 78 | const QTabWidget* wxNote_TabWidget); 79 | void _AdjustNoteItemDye(const QList<_NoteListItem *>& _Notes); 80 | 81 | signals: 82 | /* 当_FinalTabWindow中已经有了该笔记的shadow, 发射该信号 */ 83 | void _NoteItemBeDCSignal_NonOpened(_MainWindowShadow* _EditWindow, 84 | const QString& _EditWindowTitle, 85 | const QIcon& _Icon); 86 | /* 如果_FinalTabWindow中还没有该笔记的shadow, 发射该信号 */ 87 | void _NoteItemBeDCSignal_BeOpened(_TextEditorWindow* _EditorWindow); 88 | 89 | void _SetTabIconSignal(const QIcon& _Icon); 90 | 91 | protected slots: 92 | void _SetCurrentNoteItemPreview(const _TextEditorWindow* _EditorWindow, 93 | const QString& _NoteTitle, 94 | const QString& _PreviewText); 95 | 96 | void _SetCurrentNoteItem_NoteName(const QString& _NoteName); 97 | 98 | protected: 99 | enum { _SoLongTitleStd = 13 }; 100 | 101 | void mouseDoubleClickEvent(QMouseEvent *_Event); 102 | _TextEditorWindow* _GetCurrentNoteEditorWindow() const; 103 | 104 | bool _IsCurrentNoteListAllHidden(); 105 | 106 | bool _HasSpecifiedShadowWindow( 107 | const _TextEditorWindow* _ShadowWindow); 108 | 109 | QString _GetCurrentNoteCategories(const _TextEditorWindow* _CurrentEW); 110 | QString _GetCurrentNoteRating(const _TextEditorWindow* _CurrentEW); 111 | }; 112 | 113 | //////////////////////////////////////////////////////////////////////////// 114 | 115 | /*************************************************************************** 116 | ** ** 117 | ** _________ _______ ** 118 | ** |___ ___| / ______ \ ** 119 | ** | | _______ _______ _______ | / |_| ** 120 | ** | | || || || || || || | | _ __ ** 121 | ** | | || || || || || || | | |__ \ ** 122 | ** | | || || || || || || | \_ _ __| | _ ** 123 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 124 | ** || ** 125 | ** ||_____|| ** 126 | ** ** 127 | ***************************************************************************/ 128 | ///:~ 129 | 130 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/FontComboBox.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Other/FontComboBox.h" 35 | 36 | //.._FontComboBox类实现 37 | 38 | /* 构造函数实现 */ 39 | _FontComboBox::_FontComboBox(QWidget *_Parent) 40 | : QFontComboBox(_Parent) 41 | {;} 42 | 43 | ///////////////////////////////////////////////////////////////////////// 44 | //..protected部分 45 | 46 | /* sizeHint()函数重写 */ 47 | QSize _FontComboBox::sizeHint() const 48 | { 49 | return QSize(84, 25); 50 | } 51 | 52 | //////////////////////////////////////////////////////////////////////////// 53 | 54 | /*************************************************************************** 55 | ** ** 56 | ** _________ _______ ** 57 | ** |___ ___| / ______ \ ** 58 | ** | | _______ _______ _______ | / |_| ** 59 | ** | | || || || || || || | | _ __ ** 60 | ** | | || || || || || || | | |__ \ ** 61 | ** | | || || || || || || | \_ _ __| | _ ** 62 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 63 | ** || ** 64 | ** ||_____|| ** 65 | ** ** 66 | ***************************************************************************/ 67 | ///:~ 68 | 69 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/FontComboBox.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _FontComboBox : public QFontComboBox 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _FontComboBox(QWidget* _Parent = nullptr); 43 | 44 | protected: 45 | QSize sizeHint() const; 46 | }; 47 | 48 | //////////////////////////////////////////////////////////////////////////// 49 | 50 | /*************************************************************************** 51 | ** ** 52 | ** _________ _______ ** 53 | ** |___ ___| / ______ \ ** 54 | ** | | _______ _______ _______ | / |_| ** 55 | ** | | || || || || || || | | _ __ ** 56 | ** | | || || || || || || | | |__ \ ** 57 | ** | | || || || || || || | \_ _ __| | _ ** 58 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 59 | ** || ** 60 | ** ||_____|| ** 61 | ** ** 62 | ***************************************************************************/ 63 | ///:~ 64 | 65 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/FontSizeComboBox.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Other/FontSizeComboBox.h" 35 | 36 | //.._FontSizeComboBox类实现 37 | 38 | /* 构造函数实现 */ 39 | _FontSizeComboBox::_FontSizeComboBox(QWidget *_Parent) 40 | : QComboBox(_Parent) 41 | {;} 42 | 43 | ///////////////////////////////////////////////////////////////////////// 44 | //..protected部分实现 45 | 46 | /* sizeHint()函数重写 */ 47 | QSize _FontSizeComboBox::sizeHint() const 48 | { 49 | return QSize(45, 25); 50 | } 51 | 52 | //////////////////////////////////////////////////////////////////////////// 53 | 54 | /*************************************************************************** 55 | ** ** 56 | ** _________ _______ ** 57 | ** |___ ___| / ______ \ ** 58 | ** | | _______ _______ _______ | / |_| ** 59 | ** | | || || || || || || | | _ __ ** 60 | ** | | || || || || || || | | |__ \ ** 61 | ** | | || || || || || || | \_ _ __| | _ ** 62 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 63 | ** || ** 64 | ** ||_____|| ** 65 | ** ** 66 | ***************************************************************************/ 67 | ///:~ 68 | 69 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/FontSizeComboBox.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _FontSizeComboBox : public QComboBox 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _FontSizeComboBox(QWidget* _Parent = nullptr); 43 | 44 | protected: 45 | QSize sizeHint() const; 46 | }; 47 | 48 | //////////////////////////////////////////////////////////////////////////// 49 | 50 | /*************************************************************************** 51 | ** ** 52 | ** _________ _______ ** 53 | ** |___ ___| / ______ \ ** 54 | ** | | _______ _______ _______ | / |_| ** 55 | ** | | || || || || || || | | _ __ ** 56 | ** | | || || || || || || | | |__ \ ** 57 | ** | | || || || || || || | \_ _ __| | _ ** 58 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 59 | ** || ** 60 | ** ||_____|| ** 61 | ** ** 62 | ***************************************************************************/ 63 | ///:~ 64 | 65 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/NoteEditorSplitter.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Other/NoteEditorSplitter.h" 35 | 36 | #include "wxNote_Global.h" 37 | 38 | //.._NoteEditorSplitter类实现 39 | 40 | /* 构造函数实现 */ 41 | _NoteEditorSplitter::_NoteEditorSplitter(Qt::Orientation _Orientation, 42 | QWidget *_Parent) 43 | : QSplitter(_Orientation, _Parent), 44 | m_ParentNoteName_Current(wxNote::g_NonTitleNoteName) 45 | {;} 46 | 47 | /* _SetParentNoteName()函数实现 */ 48 | void _NoteEditorSplitter::_SetParentNoteName(const QString &_NoteName) 49 | { 50 | m_ParentNoteName_Current = _NoteName; 51 | } 52 | 53 | /* _GetParentNoteName()函数实现 */ 54 | QString _NoteEditorSplitter::_GetParentNoteName() const 55 | { 56 | return m_ParentNoteName_Current; 57 | } 58 | 59 | /* _SetBeforeDeletedParentNoteName()函数实现 */ 60 | void _NoteEditorSplitter 61 | ::_SetBeforeDeletedParentNoteName(const QString &_NoteName) 62 | { 63 | m_ParentNoteName_BeforeDeleted = _NoteName; 64 | } 65 | 66 | /* _GetBeforeDeletedParentNoteName()函数实现 */ 67 | QString _NoteEditorSplitter::_GetBeforeDeletedParentNoteName() const 68 | { 69 | return m_ParentNoteName_BeforeDeleted; 70 | } 71 | 72 | //////////////////////////////////////////////////////////////////////////// 73 | 74 | /*************************************************************************** 75 | ** ** 76 | ** _________ _______ ** 77 | ** |___ ___| / ______ \ ** 78 | ** | | _______ _______ _______ | / |_| ** 79 | ** | | || || || || || || | | _ __ ** 80 | ** | | || || || || || || | | |__ \ ** 81 | ** | | || || || || || || | \_ _ __| | _ ** 82 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 83 | ** || ** 84 | ** ||_____|| ** 85 | ** ** 86 | ***************************************************************************/ 87 | ///:~ 88 | 89 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/NoteEditorSplitter.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _NoteEditorSplitter : public QSplitter 38 | { 39 | Q_OBJECT 40 | 41 | public: 42 | _NoteEditorSplitter(Qt::Orientation _Orientation, 43 | QWidget* _Parent = nullptr); 44 | 45 | /* 设置当前编辑窗口所属的笔记的名称 */ 46 | void _SetParentNoteName(const QString& _NoteName); 47 | /* 获取当前编辑窗口所属的笔记的名称 */ 48 | QString _GetParentNoteName() const; 49 | 50 | /* 设置该编辑窗口被移动到废纸篓前的父笔记本的名称 */ 51 | void _SetBeforeDeletedParentNoteName(const QString& _NoteName); 52 | /* 获取该编辑窗口被移动到废纸篓前的父笔记本的名称 */ 53 | QString _GetBeforeDeletedParentNoteName() const; 54 | 55 | protected: 56 | QString m_ParentNoteName_Current; 57 | QString m_ParentNoteName_BeforeDeleted; 58 | }; 59 | 60 | //////////////////////////////////////////////////////////////////////////// 61 | 62 | /*************************************************************************** 63 | ** ** 64 | ** _________ _______ ** 65 | ** |___ ___| / ______ \ ** 66 | ** | | _______ _______ _______ | / |_| ** 67 | ** | | || || || || || || | | _ __ ** 68 | ** | | || || || || || || | | |__ \ ** 69 | ** | | || || || || || || | \_ _ __| | _ ** 70 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 71 | ** || ** 72 | ** ||_____|| ** 73 | ** ** 74 | ***************************************************************************/ 75 | ///:~ 76 | 77 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/SearchPanel.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "SearchPanel.h" 35 | #include "wxNote_Gui/wxNote_Button/NestingButton.h" 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | //.._SearchPanel类实现 42 | 43 | /* 构造函数实现 */ 44 | _SearchPanel::_SearchPanel(QWidget *_Parent) 45 | : QWidget(_Parent) 46 | { 47 | m_FontFamily = "微软雅黑,12,-1,5,50,0,0,0,0,0"; 48 | 49 | m_SearchLineEdit = new QLineEdit; 50 | m_SearchLineEdit->setPlaceholderText(tr("搜索笔记")); 51 | m_SearchLineEdit->setStyleSheet("color : rgb(88, 88, 88)"); 52 | m_SearchLineEdit->setFont(QFont(m_FontFamily, 10, 10, true)); 53 | m_SearchLineEdit->setFixedHeight(_SearchLineEditMimimumHeight); 54 | 55 | m_ControlToolButton = new _NestingButton(QIcon(":/wxNote_Icons/beginSearch.png"), 56 | m_SearchLineEdit); 57 | 58 | m_SearchHorizontalLayout = new QHBoxLayout; 59 | m_SearchHorizontalLayout->addWidget(m_SearchLineEdit); 60 | 61 | connect(m_SearchLineEdit, SIGNAL(textChanged(QString)), 62 | this, SLOT(_SearchLineEditBeginSearchSlot(QString))); 63 | connect(m_ControlToolButton, SIGNAL(clicked()), 64 | this, SLOT(_ControlToolButtonClicked())); 65 | 66 | this->setLayout(m_SearchHorizontalLayout); 67 | this->setFixedHeight(_SearchPanelMinimumHeight); 68 | } 69 | 70 | ///////////////////////////////////////////////////////////////////////// 71 | //..protected部分 72 | 73 | /* _SearchLineEditBeginSearchSlot()槽实现 */ 74 | void _SearchPanel::_SearchLineEditBeginSearchSlot(const QString &_Text) 75 | { 76 | if (!_Text.isEmpty()) 77 | { 78 | m_SearchLineEdit->setStyleSheet("color : black"); 79 | _SetSearchLineIsItalic(false); 80 | 81 | m_ControlToolButton->setIcon(QIcon(":wxNote_Icons/stopSearch.png")); 82 | m_ControlToolButton->setToolTip(tr("结束搜索")); 83 | } 84 | else 85 | { 86 | m_SearchLineEdit->setStyleSheet("color : rgb(88, 88, 88)"); 87 | _SetSearchLineIsItalic(true); 88 | 89 | m_ControlToolButton->setIcon(QIcon(":wxNote_Icons/beginSearch.png")); 90 | m_ControlToolButton->setToolTip(tr("开始搜索")); 91 | } 92 | } 93 | 94 | /* _ControlToolButtonClicked()槽实现 */ 95 | void _SearchPanel::_ControlToolButtonClicked() 96 | { 97 | if (m_ControlToolButton->toolTip() == tr("结束搜索")) 98 | { 99 | m_SearchLineEdit->clear(); 100 | 101 | emit _StopFilterSignal(); 102 | // TODO 103 | } 104 | else 105 | emit _BeginFilterSignal(); 106 | } 107 | 108 | /* _SetSearchLineIsItalic()函数实现 */ 109 | void _SearchPanel::_SetSearchLineIsItalic(bool _IsItaic) 110 | { 111 | m_SearchLineEdit->setFont(QFont(m_FontFamily, 10, 10, _IsItaic)); 112 | } 113 | 114 | 115 | //////////////////////////////////////////////////////////////////////////// 116 | 117 | /*************************************************************************** 118 | ** ** 119 | ** _________ _______ ** 120 | ** |___ ___| / ______ \ ** 121 | ** | | _______ _______ _______ | / |_| ** 122 | ** | | || || || || || || | | _ __ ** 123 | ** | | || || || || || || | | |__ \ ** 124 | ** | | || || || || || || | \_ _ __| | _ ** 125 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 126 | ** || ** 127 | ** ||_____|| ** 128 | ** ** 129 | ***************************************************************************/ 130 | ///:~ 131 | 132 | 133 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Other/SearchPanel.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _NestingButton; 38 | 39 | class QHBoxLayout; 40 | class QLineEdit; 41 | 42 | class _SearchPanel : public QWidget 43 | { 44 | Q_OBJECT 45 | 46 | public: 47 | _SearchPanel(QWidget* _Parent = nullptr); 48 | 49 | QLineEdit* _GetSearchLineEdit() const 50 | { return m_SearchLineEdit; } 51 | 52 | signals: 53 | void _BeginFilterSignal(); 54 | void _StopFilterSignal(); 55 | 56 | protected slots: 57 | void _SearchLineEditBeginSearchSlot(const QString& _Text); 58 | void _ControlToolButtonClicked(); 59 | 60 | protected: 61 | enum { _SearchLineEditMimimumHeight = 23 }; 62 | enum { _SearchPanelMinimumHeight = 41 }; 63 | 64 | inline void _SetSearchLineIsItalic(bool _IsItaic); 65 | 66 | QString m_FontFamily; 67 | 68 | _NestingButton* m_ControlToolButton; 69 | 70 | QLineEdit* m_SearchLineEdit; 71 | QHBoxLayout* m_SearchHorizontalLayout; 72 | }; 73 | 74 | //////////////////////////////////////////////////////////////////////////// 75 | 76 | /*************************************************************************** 77 | ** ** 78 | ** _________ _______ ** 79 | ** |___ ___| / ______ \ ** 80 | ** | | _______ _______ _______ | / |_| ** 81 | ** | | || || || || || || | | _ __ ** 82 | ** | | || || || || || || | | |__ \ ** 83 | ** | | || || || || || || | \_ _ __| | _ ** 84 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 85 | ** || ** 86 | ** ||_____|| ** 87 | ** ** 88 | ***************************************************************************/ 89 | ///:~ 90 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Tree/CategoriesTree.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Tree/CategoriesTree.h" 35 | 36 | #include "wxNote_Global.h" 37 | 38 | #include 39 | 40 | //.._CategoriesTree类实现 41 | 42 | /* 构造函数实现 */ 43 | _CategoriesTree::_CategoriesTree(QWidget *_Parent) 44 | : QTreeWidget(_Parent) 45 | { 46 | /* "评分" */ 47 | m_RatingRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_RatingListName); 48 | m_RatingRootItem->setIcon(0, QIcon(":/wxNote_Icons/rating.png")); 49 | m_RatingRootItem->setExpanded(true); 50 | 51 | m_ExcellentItem = new QTreeWidgetItem( 52 | m_RatingRootItem, QStringList() << wxNote::g_ExcellentName); 53 | m_ExcellentItem->setIcon(0, QIcon(":/wxNote_Icons/excellent.png")); 54 | 55 | m_GoodItem = new QTreeWidgetItem( 56 | m_RatingRootItem, QStringList() << wxNote::g_GoodName); 57 | m_GoodItem->setIcon(0, QIcon(":/wxNote_Icons/good.png")); 58 | 59 | m_AverageItem = new QTreeWidgetItem( 60 | m_RatingRootItem, QStringList() << wxNote::g_AverageName); 61 | m_AverageItem->setIcon(0, QIcon(":/wxNote_Icons/average.png")); 62 | 63 | m_FairItem = new QTreeWidgetItem( 64 | m_RatingRootItem, QStringList() << wxNote::g_FairName); 65 | m_FairItem->setIcon(0, QIcon(":/wxNote_Icons/fair.png")); 66 | 67 | m_PoorItem = new QTreeWidgetItem( 68 | m_RatingRootItem, QStringList() << ("差")); 69 | m_PoorItem->setIcon(0, QIcon(":/wxNote_Icons/poor.png")); 70 | 71 | /* "颜色标签" */ 72 | m_ColorLabelRootItem = new QTreeWidgetItem( 73 | this, QStringList() << wxNote::g_ColorLabelListName); 74 | m_ColorLabelRootItem->setIcon(0, QIcon(":/wxNote_Icons/colorLabel.png")); 75 | m_ColorLabelRootItem->setExpanded(true); 76 | 77 | m_ImportantItem = new QTreeWidgetItem(m_ColorLabelRootItem, 78 | QStringList() << wxNote::g_ImportantName); 79 | m_ImportantItem->setIcon(0, QIcon(":/wxNote_Icons/important.png")); 80 | 81 | m_WorkItem = new QTreeWidgetItem(m_ColorLabelRootItem, 82 | QStringList() << wxNote::g_WorkName); 83 | m_WorkItem->setIcon(0, QIcon(":/wxNote_Icons/work.png")); 84 | 85 | m_PersonalItem = new QTreeWidgetItem(m_ColorLabelRootItem, 86 | QStringList() << wxNote::g_PersonalName); 87 | m_PersonalItem->setIcon(0, QIcon(":/wxNote_Icons/personal.png")); 88 | 89 | m_ToDoItem = new QTreeWidgetItem(m_ColorLabelRootItem, 90 | QStringList() << wxNote::g_ToDoName); 91 | m_ToDoItem->setIcon(0, QIcon(":/wxNote_Icons/toDo.png")); 92 | 93 | m_LaterItem = new QTreeWidgetItem(m_ColorLabelRootItem, 94 | QStringList() << wxNote::g_LaterName); 95 | m_LaterItem->setIcon(0, QIcon(":/wxNote_Icons/later.png")); 96 | 97 | setCurrentItem(m_RatingRootItem); 98 | setHeaderHidden(true); 99 | } 100 | 101 | //////////////////////////////////////////////////////////////////////////// 102 | 103 | /*************************************************************************** 104 | ** ** 105 | ** _________ _______ ** 106 | ** |___ ___| / ______ \ ** 107 | ** | | _______ _______ _______ | / |_| ** 108 | ** | | || || || || || || | | _ __ ** 109 | ** | | || || || || || || | | |__ \ ** 110 | ** | | || || || || || || | \_ _ __| | _ ** 111 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 112 | ** || ** 113 | ** ||_____|| ** 114 | ** ** 115 | ***************************************************************************/ 116 | ///:~ 117 | 118 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Tree/CategoriesTree.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QTreeWidgetItem; 38 | 39 | class _CategoriesTree : public QTreeWidget 40 | { 41 | Q_OBJECT 42 | 43 | public: 44 | _CategoriesTree(QWidget* _Parent = nullptr); 45 | 46 | QTreeWidgetItem* _GetColorLabelRootItem() const 47 | { return m_ColorLabelRootItem; } 48 | QTreeWidgetItem* _GetImportantItem() const 49 | { return m_ImportantItem; } 50 | QTreeWidgetItem* _GetWorkItem() const 51 | { return m_WorkItem; } 52 | QTreeWidgetItem* _GetPersonalItem() const 53 | { return m_PersonalItem; } 54 | QTreeWidgetItem* _GetToDoItem() const 55 | { return m_ToDoItem; } 56 | QTreeWidgetItem* _GetLaterItem() const 57 | { return m_LaterItem; } 58 | 59 | protected: 60 | /* "评分" */ 61 | QTreeWidgetItem* m_RatingRootItem; 62 | 63 | QTreeWidgetItem* m_ExcellentItem; 64 | QTreeWidgetItem* m_GoodItem; 65 | QTreeWidgetItem* m_AverageItem; 66 | QTreeWidgetItem* m_FairItem; 67 | QTreeWidgetItem* m_PoorItem; 68 | 69 | /* "颜色标签" */ 70 | QTreeWidgetItem* m_ColorLabelRootItem; 71 | 72 | QTreeWidgetItem* m_ImportantItem; 73 | QTreeWidgetItem* m_WorkItem; 74 | QTreeWidgetItem* m_PersonalItem; 75 | QTreeWidgetItem* m_ToDoItem; 76 | QTreeWidgetItem* m_LaterItem; 77 | }; 78 | 79 | //////////////////////////////////////////////////////////////////////////// 80 | 81 | /*************************************************************************** 82 | ** ** 83 | ** _________ _______ ** 84 | ** |___ ___| / ______ \ ** 85 | ** | | _______ _______ _______ | / |_| ** 86 | ** | | || || || || || || | | _ __ ** 87 | ** | | || || || || || || | | |__ \ ** 88 | ** | | || || || || || || | \_ _ __| | _ ** 89 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 90 | ** || ** 91 | ** ||_____|| ** 92 | ** ** 93 | ***************************************************************************/ 94 | ///:~ 95 | 96 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Tree/NoteBookTree.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Gui/wxNote_Tree/NoteBookTree.h" 35 | 36 | #include "wxNote_Global.h" 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | //.._NoteBookTree类实现 43 | 44 | int _NoteBookTree::s_AllNotesCnt = 0; 45 | int _NoteBookTree::s_TrashCnt = 0; 46 | 47 | /* 构造函数实现 */ 48 | _NoteBookTree::_NoteBookTree(QWidget *_Parent) 49 | : QTreeWidget(_Parent) 50 | { 51 | setColumnCount(m_ColumnCnt); 52 | 53 | /* "笔记"根 */ 54 | m_NoteBookRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_NoteBooksName); 55 | m_NoteBookRootItem->setIcon(0, QIcon(":/wxNote_Icons/noteBook.png")); 56 | 57 | m_AllNoteBookSubItem = new QTreeWidgetItem(m_NoteBookRootItem, 58 | QStringList() << wxNote::g_AllNotesName); 59 | m_AllNoteBookSubItem->setIcon(0, QIcon(":/wxNote_Icons/allNotes.png")); 60 | 61 | /* "标签"根 */ 62 | m_LabelRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_LabelName); 63 | m_LabelRootItem->setIcon(0, QIcon(":/wxNote_Icons/label.png")); 64 | 65 | /* "属性"根 */ 66 | m_PropertiesRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_PropertiesName); 67 | m_PropertiesRootItem->setIcon(0, QIcon(":/wxNote_Icons/property.png")); 68 | 69 | /* "废纸篓"根 */ 70 | m_TrashRootItem = new QTreeWidgetItem(this, QStringList() << wxNote::g_TrashName); 71 | m_TrashRootItem->setIcon(0, QIcon(":/wxNote_Icons/trash.png")); 72 | 73 | // _CreateContextMenu()存在BUG! 74 | 75 | setCurrentItem(m_AllNoteBookSubItem); 76 | setIconSize(QSize(30,30)); 77 | setHeaderLabels(QStringList() << wxNote::g_NoteBooksName); 78 | setHeaderHidden(true); 79 | 80 | _RestoreUsersNoteBook(); 81 | } 82 | 83 | /* _NoteBookCountIncreaseSlot()槽实现 */ 84 | void _NoteBookTree::_NoteBookCountIncreaseSlot() 85 | { 86 | m_AllNoteBookSubItem->setText(0, wxNote::g_AllNotesName); 87 | } 88 | 89 | /* _NoteBookCountDecreaseSlot()槽实现 */ 90 | void _NoteBookTree::_NoteBookCountDecreaseSlot() 91 | { 92 | m_AllNoteBookSubItem->setText(0, wxNote::g_AllNotesName); 93 | } 94 | 95 | /* _TrashCountIncreaseSlot()槽实现 */ 96 | void _NoteBookTree::_TrashCountIncreaseSlot() 97 | { 98 | m_TrashRootItem->setText(0, wxNote::g_TrashName); 99 | } 100 | 101 | /* _TrashCountDecreaseSlot()槽实现 */ 102 | void _NoteBookTree::_TrashCountDecreaseSlot() 103 | { 104 | m_TrashRootItem->setText(0, wxNote::g_TrashName); 105 | } 106 | 107 | ///////////////////////////////////////////////////////////////////////// 108 | //..protected部分 109 | 110 | /* _CreateActionOnContextMenu()函数实现 */ 111 | void _NoteBookTree::_CreateActionsOnContextMenu() 112 | { 113 | /* "新建笔记本"动作 */ 114 | m_NewNoteBookAction = new QAction(tr("新建笔记本(&C)"), this); 115 | m_NewNoteBookAction->setShortcut(tr("Insert")); 116 | m_NewNoteBookAction->setToolTip(tr("新建笔记本")); 117 | 118 | /* "重命名 笔记本"动作 */ 119 | m_RenameAction = new QAction(tr("重命名(&R)"), this); 120 | m_RenameAction->setShortcut(tr("F2")); 121 | m_RenameAction->setToolTip(tr("重命名笔记本")); 122 | 123 | /* "删除笔记本" 动作 */ 124 | m_DeleteNoteBookAction = new QAction(tr("删除(&D)..."), this); 125 | m_DeleteNoteBookAction->setShortcut(QKeySequence::Delete); 126 | m_DeleteNoteBookAction->setToolTip(tr("删除笔记本")); 127 | } 128 | 129 | /* _CreateContextMenu()函数实现 */ 130 | void _NoteBookTree::_CreateContextMenu() 131 | { 132 | addAction(m_NewNoteBookAction); 133 | addAction(m_RenameAction); 134 | addAction(m_DeleteNoteBookAction); 135 | setContextMenuPolicy(Qt::ActionsContextMenu); 136 | } 137 | 138 | /* _RestoreUsersNoteBook()函数实现 */ 139 | void _NoteBookTree::_RestoreUsersNoteBook() 140 | { 141 | using namespace wxNote; 142 | 143 | g_Settings.beginGroup("MainWindow"); 144 | 145 | QStringList _UserNoteBookNameList = 146 | g_Settings.value("UserNoteBookNames").toStringList(); 147 | 148 | g_Settings.endGroup(); 149 | 150 | g_UserNoteBookNameList = _UserNoteBookNameList; 151 | 152 | for (const QString& _Elem : _UserNoteBookNameList) 153 | { 154 | QTreeWidgetItem* _NewNoteBookItem = 155 | new QTreeWidgetItem(m_NoteBookRootItem, QStringList() << _Elem); 156 | 157 | _NewNoteBookItem->setIcon(0, QIcon(":/wxNote_Icons/noteBook.png")); 158 | } 159 | } 160 | 161 | //////////////////////////////////////////////////////////////////////////// 162 | 163 | /*************************************************************************** 164 | ** ** 165 | ** _________ _______ ** 166 | ** |___ ___| / ______ \ ** 167 | ** | | _______ _______ _______ | / |_| ** 168 | ** | | || || || || || || | | _ __ ** 169 | ** | | || || || || || || | | |__ \ ** 170 | ** | | || || || || || || | \_ _ __| | _ ** 171 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 172 | ** || ** 173 | ** ||_____|| ** 174 | ** ** 175 | ***************************************************************************/ 176 | ///:~ 177 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Tree/NoteBookTree.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class QTreeWidgetItem; 38 | class QAction; 39 | 40 | //..该类定义了一个在_MainWindowNormal中显示的笔记列表 41 | class _NoteBookTree : public QTreeWidget 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | _NoteBookTree(QWidget* _Parent = nullptr); 47 | 48 | QTreeWidgetItem* _GetNoteBookRoot() const { return m_NoteBookRootItem; } 49 | QTreeWidgetItem* _GetLabelBookRoot() const { return m_LabelRootItem; } 50 | QTreeWidgetItem* _GetPropertiesRoot() const { return m_PropertiesRootItem; } 51 | QTreeWidgetItem* _GetTrashRootRoot() const { return m_TrashRootItem; } 52 | 53 | QTreeWidgetItem* _GetAllNoteBook() const { return m_AllNoteBookSubItem; } 54 | 55 | void _SetCurrentItemIsNoteBookRoot() 56 | { setCurrentItem(m_NoteBookRootItem, 0); } 57 | 58 | void _SetCurrentItemIsAllNoteSubRoot() 59 | { setCurrentItem(m_AllNoteBookSubItem, 0); } 60 | 61 | void _SetCurrentItemIsLabelRoot() 62 | { setCurrentItem(m_LabelRootItem, 0); } 63 | 64 | void _SetCurrentItemIsPropertiesRoot() 65 | { setCurrentItem(m_PropertiesRootItem, 0); } 66 | 67 | void _SetCurrentItemIsTrash() 68 | { setCurrentItem(m_TrashRootItem, 0); } 69 | 70 | public slots: 71 | void _NoteBookCountIncreaseSlot(); 72 | void _NoteBookCountDecreaseSlot(); 73 | void _TrashCountIncreaseSlot(); 74 | void _TrashCountDecreaseSlot(); 75 | 76 | protected: 77 | enum { m_ColumnCnt = 1 }; 78 | static int s_AllNotesCnt; 79 | static int s_TrashCnt; 80 | 81 | void _CreateActionsOnContextMenu(); 82 | void _CreateContextMenu(); 83 | 84 | void _RestoreUsersNoteBook(); 85 | 86 | /* 上下文菜单中的QAction */ 87 | QAction* m_NewNoteBookAction; 88 | QAction* m_RenameAction; 89 | QAction* m_DeleteNoteBookAction; 90 | 91 | /* "笔记"根 */ 92 | QTreeWidgetItem* m_NoteBookRootItem; 93 | QTreeWidgetItem* m_AllNoteBookSubItem; 94 | 95 | /* "标签"根 */ 96 | QTreeWidgetItem* m_LabelRootItem; 97 | 98 | /* "属性"根 */ 99 | QTreeWidgetItem* m_PropertiesRootItem; 100 | 101 | /* "废纸篓"根 */ 102 | QTreeWidgetItem* m_TrashRootItem; 103 | }; 104 | 105 | //////////////////////////////////////////////////////////////////////////// 106 | 107 | /*************************************************************************** 108 | ** ** 109 | ** _________ _______ ** 110 | ** |___ ___| / ______ \ ** 111 | ** | | _______ _______ _______ | / |_| ** 112 | ** | | || || || || || || | | _ __ ** 113 | ** | | || || || || || || | | |__ \ ** 114 | ** | | || || || || || || | \_ _ __| | _ ** 115 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 116 | ** || ** 117 | ** ||_____|| ** 118 | ** ** 119 | ***************************************************************************/ 120 | ///:~ 121 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Window/AbstractMainWindow.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _AboutwxNote; 38 | class _wxNote_ToolButton; 39 | 40 | class QMenuBar; 41 | class QMenu; 42 | class QAction; 43 | class QToolBar; 44 | class QToolButton; 45 | 46 | /* wxNote的主界面基类 47 | * 其派生类为: _MainWindowNormal和_MainWindowShadow 48 | * 前者为正常情况下普通的主界面, 后者为当用户双击笔记列表的相应项时显示的主界面 49 | */ 50 | class _AbstractMainWindow : public QMainWindow 51 | { 52 | Q_OBJECT 53 | 54 | public: 55 | _AbstractMainWindow(QWidget* _Parent = nullptr); 56 | 57 | signals: 58 | void _MoveNote2TrashSignal(); 59 | void _ThoroughDeleteNoteSignal(); 60 | 61 | public slots: 62 | virtual void _UndoSlot() = 0; 63 | virtual void _RedoSlot() = 0; 64 | virtual void _CutSlot() = 0; 65 | virtual void _CopySlot() = 0; 66 | virtual void _PasteSlot() = 0; 67 | virtual void _PastePlainTextSlot() = 0; 68 | virtual void _DeleteSlot() = 0; 69 | virtual void _SelectAllSlot() = 0; 70 | 71 | protected slots: 72 | virtual void _MoveNote2TrashSlot() = 0; 73 | virtual void _ThoroughDeleteCurrentNoteSlot() = 0; 74 | virtual void _RestoreNoteSlot() = 0; 75 | virtual void _ShareByEmailSlot(); 76 | virtual void _SynchronousSlot(); 77 | virtual void _AboutwxNoteSlot(); 78 | virtual void _OptionsSlot() = 0; 79 | 80 | protected: 81 | virtual void _CreateActionsAndSubMenu(); 82 | virtual void _CreateMainWinMenus(); 83 | virtual void _CreateMainWinToolBar(); 84 | virtual void _CreateToolButtonOnToolBar(); 85 | 86 | /* "文件"菜单项中的QMenu或QAction */ 87 | 88 | /* "编辑"菜单项中的QMenu或QAction */ 89 | QAction* m_UndoAction; 90 | QAction* m_RedoAction; 91 | QAction* m_CutAction; 92 | QAction* m_CopyAction; 93 | QAction* m_PasteAction; 94 | QAction* m_PastePlainTextAction; 95 | QAction* m_DeleteAction; 96 | QAction* m_SelectAllAction; 97 | 98 | /* "笔记"菜单项中的QMenu或QAction */ 99 | QMenu* m_ShareSubMenu; 100 | QAction* m_ShareByEmailAction; 101 | 102 | QAction* m_RestoreNoteAction; 103 | QAction* m_EliminateAction; 104 | 105 | QMenu* m_DeleteNoteSubMenu; 106 | QAction* m_Move2TrashAction; 107 | QAction* m_ThoroughDeleteAction; 108 | 109 | /* "工具"菜单项中的QMenu或QAction */ 110 | QAction* m_SynchronousAction; 111 | QAction* m_OptionsAction; 112 | 113 | /* "帮助"菜单项中的QMenu或QAction */ 114 | QAction* m_AboutwxNoteAction; 115 | 116 | QMenu* m_FileMenu; 117 | QMenu* m_EditMenu; 118 | QMenu* m_ViewMenu; 119 | QMenu* m_NoteMenu; 120 | QMenu* m_ToolMenu; 121 | QMenu* m_HelpMenu; 122 | 123 | /* 工具栏中的按钮 */ 124 | _wxNote_ToolButton* m_SynchronousToolButton; 125 | _wxNote_ToolButton* m_ShareToolButton; 126 | 127 | _wxNote_ToolButton* m_RestoreNoteToolButton; 128 | _wxNote_ToolButton* m_EliminateToolButton; 129 | 130 | QToolBar* m_MainWinToolBar; 131 | }; 132 | 133 | //////////////////////////////////////////////////////////////////////////// 134 | 135 | /*************************************************************************** 136 | ** ** 137 | ** _________ _______ ** 138 | ** |___ ___| / ______ \ ** 139 | ** | | _______ _______ _______ | / |_| ** 140 | ** | | || || || || || || | | _ __ ** 141 | ** | | || || || || || || | | |__ \ ** 142 | ** | | || || || || || || | \_ _ __| | _ ** 143 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 144 | ** || ** 145 | ** ||_____|| ** 146 | ** ** 147 | ***************************************************************************/ 148 | ///:~ 149 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Window/FinalTabWindow.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include 36 | 37 | class _MainWindowNormal; 38 | class _TextEditorWindow; 39 | class _MainWindowShadow; 40 | 41 | class _FinalTabWindow : public QTabWidget 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | _FinalTabWindow(QWidget* _Parent = nullptr); 47 | 48 | protected slots: 49 | void _WriteSettings(); 50 | void _ReadSettings(); 51 | 52 | void _NormalMainWindowTitleChangedSlot(const QString& _NewTitle); 53 | void _SetCurrentTabNameSlot(const QString& _NewTitle); 54 | 55 | void _CloseSpecifiedTabSlot(int _Index); 56 | 57 | /* 当_FinalTabWindow中已经有了该笔记的shadow, 调用该槽 */ 58 | void _OpenExistShadowWindowSlot(_TextEditorWindow* _ShadowEditorWindow); 59 | 60 | /* 如果_FinalTabWindow中还没有该笔记的shadow, 调用该槽 */ 61 | void _AddShadowWindow2FinalWindowSlot(_MainWindowShadow* _ShadowWindow, 62 | const QString _CurrentNoteName, 63 | const QIcon& _Icon); 64 | 65 | void _ExchangeEditorWindowOwnershipSlot(int _Index); 66 | 67 | void _ChangeMainWindowCurrentTitle(int _TabIndex); 68 | void _ChangeMainWindowCurrentTitle(const _TextEditorWindow* _CurrentEW, 69 | const QString& _NewTitle); 70 | void _ChangeCurrentTabTextSlot(const _TextEditorWindow* _CurrentEW, 71 | const QString& _Text); 72 | void _ChangeCurrentTabIconSlot(const QString& _NoteTitle, 73 | const QString& _IconPath); 74 | 75 | void _Move2NextTabSlot(); 76 | 77 | void _CloseCurrentNoteShadowWindowSlot(const _TextEditorWindow* _EditorWindow); 78 | 79 | void _ShowOptions_InShadowWindowSlot(); 80 | 81 | void _TabMovedSlot(int _From, int _2); 82 | 83 | void _AdjustCurrentTitle(const _TextEditorWindow* _EditorWindow); 84 | void _AdjustCurrentTitle(const QString& _CurrentNoteName); 85 | 86 | protected: 87 | void keyPressEvent(QKeyEvent *_Event); 88 | void closeEvent(QCloseEvent *_Event); 89 | 90 | void _CreateNormalMainWindow(); 91 | void _AdjustAllTabIndex(); 92 | 93 | /* 从wxNote::g_ShadowTextEditorList中找到 94 | * 标题与给定索引的tab的文本相同的笔记编辑窗口, 并返回该窗口的指针 */ 95 | _TextEditorWindow* _FindMatchedEditorWindow(int _TabIndex); 96 | 97 | /* 将所有shadow窗口中的编辑窗口控制权全部返回给m_NormalWindow */ 98 | void _ReturnAllEditorOwnership2NormalWindow(); 99 | 100 | /* 将指定的shadow窗口中的编辑窗口控制器返回给m_NormalWindow */ 101 | void _ReturnSpecifiedEditorOwnership_WhenClose(_TextEditorWindow* _RetEditor); 102 | 103 | _MainWindowShadow* _GetShadowWindow_BySpecifiedIndex(int _TabIndex); 104 | 105 | _MainWindowNormal* m_NormalMainWindow; 106 | 107 | /* 用于追踪整个程序中的当前shadow编辑窗口 */ 108 | _TextEditorWindow* m_CurrentShadowEditorWindow; 109 | }; 110 | 111 | //////////////////////////////////////////////////////////////////////////// 112 | 113 | /*************************************************************************** 114 | ** ** 115 | ** _________ _______ ** 116 | ** |___ ___| / ______ \ ** 117 | ** | | _______ _______ _______ | / |_| ** 118 | ** | | || || || || || || | | _ __ ** 119 | ** | | || || || || || || | | |__ \ ** 120 | ** | | || || || || || || | \_ _ __| | _ ** 121 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 122 | ** || ** 123 | ** ||_____|| ** 124 | ** ** 125 | ***************************************************************************/ 126 | ///:~ 127 | -------------------------------------------------------------------------------- /wxNote_Gui/wxNote_Window/MainWindowShadow.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include "wxNote_Gui/wxNote_Window/AbstractMainWindow.h" 36 | 37 | class _TextEditorWindow; 38 | class _NoteEditorSplitter; 39 | 40 | class _MainWindowShadow : public _AbstractMainWindow 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | _MainWindowShadow(_TextEditorWindow* _EditorWindow, 46 | QWidget* _Parent = nullptr); 47 | 48 | void _AddShadowEditorWindow(_TextEditorWindow* _ShadowWin); 49 | 50 | _TextEditorWindow* _GetShadowEditorWindow() const 51 | { return m_CurrentShadowEditorWindow; } 52 | 53 | signals: 54 | void _ShowOptions_InShadowWindowSignal(); 55 | 56 | protected slots: 57 | void _MoveNote2TrashSlot(); 58 | void _ThoroughDeleteCurrentNoteSlot(); 59 | void _RestoreNoteSlot(); 60 | 61 | void _OptionsSlot(); 62 | 63 | void _UndoSlot(); 64 | void _RedoSlot(); 65 | void _CutSlot(); 66 | void _CopySlot(); 67 | void _PasteSlot(); 68 | void _PastePlainTextSlot(); 69 | void _DeleteSlot(); 70 | void _SelectAllSlot(); 71 | 72 | protected: 73 | void _CreateMainWinToolBar(); 74 | 75 | _NoteEditorSplitter* m_MainSplitter; 76 | _TextEditorWindow* m_CurrentShadowEditorWindow; 77 | }; 78 | 79 | //////////////////////////////////////////////////////////////////////////// 80 | 81 | /*************************************************************************** 82 | ** ** 83 | ** _________ _______ ** 84 | ** |___ ___| / ______ \ ** 85 | ** | | _______ _______ _______ | / |_| ** 86 | ** | | || || || || || || | | _ __ ** 87 | ** | | || || || || || || | | |__ \ ** 88 | ** | | || || || || || || | \_ _ __| | _ ** 89 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 90 | ** || ** 91 | ** ||_____|| ** 92 | ** ** 93 | ***************************************************************************/ 94 | ///:~ 95 | 96 | -------------------------------------------------------------------------------- /wxNote_Icons/allNotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/allNotes.png -------------------------------------------------------------------------------- /wxNote_Icons/average-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/average-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/average.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/average.png -------------------------------------------------------------------------------- /wxNote_Icons/backSpace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/backSpace.png -------------------------------------------------------------------------------- /wxNote_Icons/beginSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/beginSearch.png -------------------------------------------------------------------------------- /wxNote_Icons/bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/bold.png -------------------------------------------------------------------------------- /wxNote_Icons/checkBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/checkBox.png -------------------------------------------------------------------------------- /wxNote_Icons/colorLabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/colorLabel.png -------------------------------------------------------------------------------- /wxNote_Icons/eliminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/eliminate.png -------------------------------------------------------------------------------- /wxNote_Icons/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/error.png -------------------------------------------------------------------------------- /wxNote_Icons/excellent-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/excellent-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/excellent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/excellent.png -------------------------------------------------------------------------------- /wxNote_Icons/fair-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/fair-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/fair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/fair.png -------------------------------------------------------------------------------- /wxNote_Icons/format-justify-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/format-justify-center.png -------------------------------------------------------------------------------- /wxNote_Icons/format-justify-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/format-justify-fill.png -------------------------------------------------------------------------------- /wxNote_Icons/format-justify-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/format-justify-left.png -------------------------------------------------------------------------------- /wxNote_Icons/format-justify-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/format-justify-right.png -------------------------------------------------------------------------------- /wxNote_Icons/good-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/good-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/good.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/good.png -------------------------------------------------------------------------------- /wxNote_Icons/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/help.png -------------------------------------------------------------------------------- /wxNote_Icons/important-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/important-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/important.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/important.png -------------------------------------------------------------------------------- /wxNote_Icons/insertTable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/insertTable.png -------------------------------------------------------------------------------- /wxNote_Icons/italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/italic.png -------------------------------------------------------------------------------- /wxNote_Icons/label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/label.png -------------------------------------------------------------------------------- /wxNote_Icons/later-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/later-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/later.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/later.png -------------------------------------------------------------------------------- /wxNote_Icons/locking-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/locking-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/locking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/locking.png -------------------------------------------------------------------------------- /wxNote_Icons/logoOnAbout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/logoOnAbout.png -------------------------------------------------------------------------------- /wxNote_Icons/newNote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/newNote.png -------------------------------------------------------------------------------- /wxNote_Icons/nonCategories-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/nonCategories-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/nonCategories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/nonCategories.png -------------------------------------------------------------------------------- /wxNote_Icons/nonRating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/nonRating.png -------------------------------------------------------------------------------- /wxNote_Icons/noteBook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/noteBook.png -------------------------------------------------------------------------------- /wxNote_Icons/notlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/notlock.png -------------------------------------------------------------------------------- /wxNote_Icons/oneKeyLock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/oneKeyLock.png -------------------------------------------------------------------------------- /wxNote_Icons/options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/options.png -------------------------------------------------------------------------------- /wxNote_Icons/orderedList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/orderedList.png -------------------------------------------------------------------------------- /wxNote_Icons/passwordWrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/passwordWrong.png -------------------------------------------------------------------------------- /wxNote_Icons/personal-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/personal-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/personal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/personal.png -------------------------------------------------------------------------------- /wxNote_Icons/poor-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/poor-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/poor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/poor.png -------------------------------------------------------------------------------- /wxNote_Icons/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/property.png -------------------------------------------------------------------------------- /wxNote_Icons/rating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/rating.png -------------------------------------------------------------------------------- /wxNote_Icons/reportbug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/reportbug.png -------------------------------------------------------------------------------- /wxNote_Icons/restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/restore.png -------------------------------------------------------------------------------- /wxNote_Icons/selectColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/selectColor.png -------------------------------------------------------------------------------- /wxNote_Icons/selectFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/selectFont.png -------------------------------------------------------------------------------- /wxNote_Icons/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/share.png -------------------------------------------------------------------------------- /wxNote_Icons/stopSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/stopSearch.png -------------------------------------------------------------------------------- /wxNote_Icons/synchronous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/synchronous.png -------------------------------------------------------------------------------- /wxNote_Icons/synchronousFailed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/synchronousFailed.png -------------------------------------------------------------------------------- /wxNote_Icons/toDo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/toDo-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/toDo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/toDo.png -------------------------------------------------------------------------------- /wxNote_Icons/trash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/trash.png -------------------------------------------------------------------------------- /wxNote_Icons/underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/underline.png -------------------------------------------------------------------------------- /wxNote_Icons/unorderedList.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/unorderedList.png -------------------------------------------------------------------------------- /wxNote_Icons/work-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/work-mini.png -------------------------------------------------------------------------------- /wxNote_Icons/work.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/work.png -------------------------------------------------------------------------------- /wxNote_Icons/wrongful.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/wrongful.png -------------------------------------------------------------------------------- /wxNote_Icons/wxNote.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/wxNote.ico -------------------------------------------------------------------------------- /wxNote_Icons/wxNoteicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/torinkwok/wxNote/3787ad077d2db099cde804e7fc684bd009aa2572/wxNote_Icons/wxNoteicon.png -------------------------------------------------------------------------------- /wxNote_Item/NoteListItem.cpp: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #include "wxNote_Item/NoteListItem.h" 35 | 36 | //.._NoteListItem类实现 37 | 38 | /* 构造函数实现 */ 39 | _NoteListItem::_NoteListItem(const QIcon &_IconName, 40 | const QString &_ItemName) 41 | : QListWidgetItem(_IconName, _ItemName), 42 | m_ParentNoteBookName_Current(""), 43 | enum_NoteRating(wxNote::_NonRating), 44 | enum_NoteCategories(wxNote::_NonCategories) 45 | { 46 | cout << enum_NoteCategories << endl; 47 | cout << enum_NoteRating << endl << endl; 48 | 49 | setFont(QFont("微软雅黑,12,-1,5,50,0,0,0,0,0")); 50 | setSizeHint(QSize(200, 80)); 51 | setTextColor(QColor(50, 51, 46)); 52 | } 53 | 54 | _NoteListItem::_NoteListItem(const QString &_ItemName) 55 | : QListWidgetItem(_ItemName) 56 | { 57 | setFont(QFont("微软雅黑,12,-1,5,50,0,0,0,0,0")); 58 | setSizeHint(QSize(200, 80)); 59 | setTextColor(QColor(50, 51, 46)); 60 | } 61 | 62 | /* _GetTitle()槽实现 */ 63 | QString _NoteListItem::_GetTitle() 64 | { 65 | return _GetNoteNameSlot(); 66 | } 67 | 68 | /* _SetTitle()槽实现 */ 69 | void _NoteListItem::_SetTitle(const QString &_NewTitle) 70 | { 71 | _SetNoteNameSlot(_NewTitle); 72 | } 73 | 74 | //////////////////////////////////////////////////////////////////////////// 75 | 76 | /*************************************************************************** 77 | ** ** 78 | ** _________ _______ ** 79 | ** |___ ___| / ______ \ ** 80 | ** | | _______ _______ _______ | / |_| ** 81 | ** | | || || || || || || | | _ __ ** 82 | ** | | || || || || || || | | |__ \ ** 83 | ** | | || || || || || || | \_ _ __| | _ ** 84 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 85 | ** || ** 86 | ** ||_____|| ** 87 | ** ** 88 | ***************************************************************************/ 89 | ///:~ 90 | 91 | -------------------------------------------------------------------------------- /wxNote_Item/NoteListItem.h: -------------------------------------------------------------------------------- 1 | ///: 2 | /***************************************************************************** 3 | ** ** 4 | ** .======. ** 5 | ** | INRI | ** 6 | ** | | ** 7 | ** | | ** 8 | ** .========' '========. ** 9 | ** | _ xxxx _ | ** 10 | ** | /_;-.__ / _\ _.-;_\ | ** 11 | ** | `-._`'`_/'`.-' | ** 12 | ** '========.`\ /`========' ** 13 | ** | | / | ** 14 | ** |/-.( | ** 15 | ** |\_._\ | ** 16 | ** | \ \`;| ** 17 | ** | > |/| ** 18 | ** | / // | ** 19 | ** | |// | ** 20 | ** | \(\ | ** 21 | ** | `` | ** 22 | ** | | ** 23 | ** | | ** 24 | ** | | ** 25 | ** | | ** 26 | ** \\ _ _\\| \// |//_ _ \// _ ** 27 | ** ^ `^`^ ^`` `^ ^` ``^^` `^^` `^ `^ ** 28 | ** ** 29 | ** Copyright © 1997-2013 by Tong G. ** 30 | ** ALL RIGHTS RESERVED. ** 31 | ** ** 32 | ****************************************************************************/ 33 | 34 | #pragma once 35 | #include "wxNote_Gui/wxNote_Window/TextEditorWindow.h" 36 | #include "wxNote_Global.h" 37 | 38 | #include 39 | 40 | class _TextEditorWindow; 41 | 42 | class _NoteListItem : public QListWidgetItem 43 | { 44 | public: 45 | _NoteListItem(const QIcon& _IconName, const QString& _ItemName); 46 | _NoteListItem(const QString& _ItemName = ""); 47 | 48 | /* 设置存储该笔记项的笔记本的名称 */ 49 | void _SetParentNoteBookName(const QString& _InName) 50 | { m_ParentNoteBookName_Current = _InName; } 51 | 52 | void _SetNoteRating(const wxNote::_NoteRating& _Rating) 53 | { enum_NoteRating = _Rating; } 54 | wxNote::_NoteRating _GetNoteRating() const 55 | { return enum_NoteRating; } 56 | 57 | void _SetNoteCategories(const wxNote::_NoteCategories& _Categories) 58 | { enum_NoteCategories = _Categories; } 59 | wxNote::_NoteCategories _GetNoteCategories() const 60 | { return enum_NoteCategories; } 61 | 62 | void _SetCreateDate(const QDate& _Date) 63 | { m_CreateDate = _Date; } 64 | QDate _GetCreateDate() const 65 | { return m_CreateDate; } 66 | 67 | void _SetCreateTime(const QTime& _Time) 68 | { m_CreateTime = _Time; } 69 | QTime _GetCreateTime() const 70 | { return m_CreateTime; } 71 | 72 | /* 获取存储该笔记项的笔记本的名称 */ 73 | QString _GetParentNoteBookName() const 74 | { return m_ParentNoteBookName_Current; } 75 | 76 | /* 设置该笔记项被删除前所属的父笔记本的名称 */ 77 | void _SetBeforeDeletedParentNoteBookName(const QString& _InName) 78 | { m_ParentNoteBookName_BeforeDeleted = _InName; } 79 | /* 获取该笔记项被删除前所属的父笔记本的名称 */ 80 | QString _GetBeforeDeletedParentNoteBookName() const 81 | { return m_ParentNoteBookName_BeforeDeleted; } 82 | 83 | /* 将当前笔记项与其对应的编辑窗口进行绑定 */ 84 | void _SetBindTextEW(_TextEditorWindow* _BindEW) 85 | { m_BindTextEditorWindow = _BindEW; } 86 | /* 获取与其绑定的编辑窗口 */ 87 | _TextEditorWindow* _GetBindTextEW() const 88 | { return m_BindTextEditorWindow; } 89 | 90 | public slots: 91 | QString _GetNoteNameSlot() const 92 | { return m_NoteName; } 93 | void _SetNoteNameSlot(const QString& _NoteName) 94 | { m_NoteName = _NoteName; } 95 | 96 | QString _GetTitle(); 97 | void _SetTitle(const QString& _NewTitle); 98 | 99 | protected: 100 | QDate m_CreateDate; 101 | QTime m_CreateTime; 102 | 103 | QString m_ParentNoteBookName_Current; // 用于存储该笔记项当前所属的笔记本的名称 104 | QString m_ParentNoteBookName_BeforeDeleted; // 用于存储该笔记被删除前所属的笔记本的名称 105 | 106 | QString m_NoteName; 107 | 108 | wxNote::_NoteRating enum_NoteRating; 109 | wxNote::_NoteCategories enum_NoteCategories; 110 | 111 | /* 与当前笔记项绑定的编辑窗口 */ 112 | _TextEditorWindow* m_BindTextEditorWindow; 113 | }; 114 | 115 | //////////////////////////////////////////////////////////////////////////// 116 | 117 | /*************************************************************************** 118 | ** ** 119 | ** _________ _______ ** 120 | ** |___ ___| / ______ \ ** 121 | ** | | _______ _______ _______ | / |_| ** 122 | ** | | || || || || || || | | _ __ ** 123 | ** | | || || || || || || | | |__ \ ** 124 | ** | | || || || || || || | \_ _ __| | _ ** 125 | ** |_| ||_____|| || || ||_____|| \________/ |_| ** 126 | ** || ** 127 | ** ||_____|| ** 128 | ** ** 129 | ***************************************************************************/ 130 | ///:~ 131 | 132 | --------------------------------------------------------------------------------