From 98820767f135d4374ed2561ae229e2df91ef09cc Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Thu, 11 Mar 2010 17:36:04 +0000 Subject: [PATCH] 2010-03-11 09:30 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbqt/doc/en/class_hbqplaintextedit.txt * contrib/hbqt/hbqt_hbqplaintextedit.cpp * contrib/hbqt/hbqt_hbqplaintextedit.h * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp * contrib/hbqt/qtgui/THBQPlainTextEdit.prg * contrib/hbqt/qth/HBQPlainTextEdit.qth * contrib/hbide/resources/themesex.ui * contrib/hbide/resources/themesex.uic * contrib/hbide/ideeditor.prg * contrib/hbide/idethemes.prg + Reimplemented "Themes". * Now it is possible to change current line and line area background colors. Also synchronized the current colors for these areas with rest of the theme. * Now you can apply a particular theme globally to all tabs. * Made easy the way GUI elements are presented, it is more intuitive. --- harbour/ChangeLog | 20 ++ harbour/contrib/hbide/ideeditor.prg | 43 ++++ harbour/contrib/hbide/idethemes.prg | 158 ++++++++------ harbour/contrib/hbide/resources/themesex.ui | 197 +++++++++++------- harbour/contrib/hbide/resources/themesex.uic | 143 +++++++------ .../hbqt/doc/en/class_hbqplaintextedit.txt | 16 +- .../contrib/hbqt/hbqt_hbqplaintextedit.cpp | 5 + harbour/contrib/hbqt/hbqt_hbqplaintextedit.h | 2 +- .../contrib/hbqt/qtgui/HBQPlainTextEdit.cpp | 8 + .../contrib/hbqt/qtgui/THBQPlainTextEdit.prg | 5 + harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth | 1 + 11 files changed, 390 insertions(+), 208 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7d06eedc7f..9ebc79a634 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,26 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-03-11 09:30 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * contrib/hbqt/doc/en/class_hbqplaintextedit.txt + * contrib/hbqt/hbqt_hbqplaintextedit.cpp + * contrib/hbqt/hbqt_hbqplaintextedit.h + * contrib/hbqt/qtgui/HBQPlainTextEdit.cpp + * contrib/hbqt/qtgui/THBQPlainTextEdit.prg + * contrib/hbqt/qth/HBQPlainTextEdit.qth + + * contrib/hbide/resources/themesex.ui + * contrib/hbide/resources/themesex.uic + + * contrib/hbide/ideeditor.prg + * contrib/hbide/idethemes.prg + + Reimplemented "Themes". + * Now it is possible to change current line and line area background + colors. Also synchronized the current colors for these areas + with rest of the theme. + * Now you can apply a particular theme globally to all tabs. + * Made easy the way GUI elements are presented, it is more intuitive. + 2010-03-11 18:29 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/hbtoken.c * Marked function below with HB_LEGACY_LEVEL3: diff --git a/harbour/contrib/hbide/ideeditor.prg b/harbour/contrib/hbide/ideeditor.prg index 5c3a84e80d..6bc9758356 100644 --- a/harbour/contrib/hbide/ideeditor.prg +++ b/harbour/contrib/hbide/ideeditor.prg @@ -1408,6 +1408,11 @@ CLASS IdeEdit INHERIT IdeObject METHOD hidePrototype() METHOD completeCode( p ) + METHOD setLineNumbersBkColor( nR, nG, nB ) + METHOD setCurrentLineColor( nR, nG, nB ) + METHOD down() + METHOD up() + METHOD refresh() ENDCLASS /*----------------------------------------------------------------------*/ @@ -1870,6 +1875,44 @@ METHOD IdeEdit:setNewMark() /*----------------------------------------------------------------------*/ +METHOD IdeEdit:setLineNumbersBkColor( nR, nG, nB ) + ::qEdit:hbSetLineAreaBkColor( QColor():new( nR, nG, nB ) ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:setCurrentLineColor( nR, nG, nB ) + ::qEdit:hbSetCurrentLineColor( QColor():new( nR, nG, nB ) ) + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:refresh() + ::qEdit:hbRefresh() + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:down() + LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() ) + + qCursor:movePosition( QTextCursor_Down ) + ::qEdit:setTextCursor( qCursor ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeEdit:up() + LOCAL qCursor := QTextCursor():configure( ::qEdit:textCursor() ) + + qCursor:movePosition( QTextCursor_Up ) + ::qEdit:setTextCursor( qCursor ) + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeEdit:duplicateLine() ::qEdit:hbDuplicateLine() RETURN Self diff --git a/harbour/contrib/hbide/idethemes.prg b/harbour/contrib/hbide/idethemes.prg index 026b1e0724..5010f1ad62 100644 --- a/harbour/contrib/hbide/idethemes.prg +++ b/harbour/contrib/hbide/idethemes.prg @@ -82,6 +82,9 @@ #define applyMenu_triggered_applyToCurrentTab 1 #define applyMenu_triggered_setAsDefault 2 +#define applyMenu_triggered_applyToAllTabs 3 +#define listThemes_currentRowChanged 4 +#define listItems_currentRowChanged 5 /*----------------------------------------------------------------------*/ @@ -144,6 +147,8 @@ CLASS IdeThemes INHERIT IdeObject METHOD selectThemeProc( nMode, p, oSL, cTheme ) METHOD buildINI() METHOD parseINI( lAppend ) + METHOD updateLineNumbersBkColor() + METHOD updateCurrentLineColor() ENDCLASS @@ -216,24 +221,14 @@ METHOD IdeThemes:create( oIde, cIniFile ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:destroy() - LOCAL qAct IF !empty( ::oUI ) ::qHiliter := NIL ::qEdit := NIL - FOR EACH qAct IN ::aApplyAct - ::disconnect( qAct, "triggered(bool)" ) - qAct := NIL - NEXT - ::qMenuApply := NIL - ::aApplyAct := NIL - ::oThemesDock:oWidget:setWidget( QWidget():new() ) -hbide_dbg( 0,1,"IdeThemes:destroy()" ) IF !empty( ::oUI ) ::oUI:destroy() -hbide_dbg( 1,1,"IdeThemes:destroy()" ) ENDIF ENDIF @@ -242,11 +237,31 @@ hbide_dbg( 1,1,"IdeThemes:destroy()" ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:execEvent( nMode, p ) - LOCAL oEditor + LOCAL oEditor, a_ HB_SYMBOL_UNUSED( p ) DO CASE + CASE nMode == listItems_currentRowChanged + ::nCurItem := p+1 + + IF ::nCurItem == 13 + ::updateCurrentLineColor() + ELSEIF ::nCurItem == 16 + ::updateLineNumbersBkColor() + ELSE + ::setAttributes( p ) + ENDIF + + CASE nMode == listThemes_currentRowChanged + ::nCurTheme := p+1 + ::setTheme( p ) + + CASE nMode == applyMenu_triggered_applyToAllTabs + FOR EACH a_ IN ::aTabs + a_[ TAB_OEDITOR ]:applyTheme( ::aThemes[ ::nCurTheme, 1 ] ) + NEXT + CASE nMode == applyMenu_triggered_applyToCurrentTab IF !empty( oEditor := ::oEM:getEditorCurrent() ) oEditor:applyTheme( ::aThemes[ ::nCurTheme, 1 ] ) @@ -444,6 +459,14 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) ::setSingleLineCommentRule( qHiliter, cTheme ) ::setQuotesRule( qHiliter, cTheme ) + IF __ObjGetClsName( qEdit ) == "HBQPLAINTEXTEDIT" + aAttr := ::getThemeAttribute( "CurrentLineBackground", cTheme ) + qEdit:hbSetCurrentLineColor( QColor():new( aAttr[ THM_ATR_R ], aAttr[ THM_ATR_G ], aAttr[ THM_ATR_B ] ) ) + + aAttr := ::getThemeAttribute( "LineNumbersBkColor", cTheme ) + qEdit:hbSetLineAreaBkColor( QColor():new( aAttr[ THM_ATR_R ], aAttr[ THM_ATR_G ], aAttr[ THM_ATR_B ] ) ) + ENDIF + qHiliter:setDocument( qEdit:document() ) RETURN qHiliter @@ -451,25 +474,23 @@ METHOD IdeThemes:setSyntaxHilighting( qEdit, cTheme, lNew ) /*----------------------------------------------------------------------*/ METHOD IdeThemes:show() - #if 1 - LOCAL qAct - #endif IF empty( ::oUI ) ::lCreating := .t. ::oUI := HbQtUI():new( hbide_uic( "themesex" ) ):build() - - //::oThemesDock:qtObject := Self ::oThemesDock:oWidget:setWidget( ::oUI ) - ::oUI:signal( "comboThemes" , "currentIndexChanged(int)", {|i| ::nCurTheme := i+1, ::setTheme( i ) } ) - ::oUI:signal( "comboItems" , "currentIndexChanged(int)", {|i| ::nCurItem := i+1, ::setAttributes( i ) } ) + ::oUI:signal( "listThemes" , "currentRowChanged(int)" , {|i| ::execEvent( listThemes_currentRowChanged, i ) } ) + ::oUI:signal( "listItems" , "currentRowChanged(int)" , {|i| ::execEvent( listItems_currentRowChanged, i ) } ) ::oUI:signal( "buttonColor" , "clicked()" , {|| ::updateColor() } ) ::oUI:signal( "buttonSave" , "clicked()" , {|| ::save( .f. ) } ) ::oUI:signal( "buttonSaveAs" , "clicked()" , {|| ::save( .t. ) } ) ::oUI:signal( "buttonCopy" , "clicked()" , {|| ::copy( .t. ) } ) + ::oUI:signal( "buttonApply" , "clicked()" , {|| ::execEvent( applyMenu_triggered_applyToCurrentTab ) } ) + ::oUI:signal( "buttonApplyAll", "clicked()" , {|| ::execEvent( applyMenu_triggered_applyToAllTabs ) } ) + ::oUI:signal( "buttonDefault" , "clicked()" , {|| ::execEvent( applyMenu_triggered_setAsDefault ) } ) ::oUI:signal( "checkItalic" , "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_ITALIC, i ) } ) ::oUI:signal( "checkBold" , "stateChanged(int)" , {|i| ::updateAttribute( THM_ATR_BOLD , i ) } ) @@ -478,7 +499,6 @@ METHOD IdeThemes:show() ::oUI:signal( "buttonClose" , "clicked()" , {|| ::oThemesDock:hide() } ) /* Fill Themes Dialog Values */ - #if 1 ::oUI:setWindowTitle( GetKeyValue( ::aControls, "dialogTitle" ) ) // ::oUI:qObj[ "labelItems" ]:setText( GetKeyValue( ::aControls, "labelItems" , "Items" ) ) @@ -493,31 +513,9 @@ METHOD IdeThemes:show() ::oUI:qObj[ "buttonSaveAs" ]:setText( GetKeyValue( ::aControls, "buttonSaveAs" , "SaveAs" ) ) ::oUI:qObj[ "buttonClose" ]:setText( GetKeyValue( ::aControls, "buttonClose" , "Close" ) ) ::oUI:qObj[ "buttonCopy" ]:setText( GetKeyValue( ::aControls, "buttonCopy" , "Copy" ) ) - #endif - #if 1 - ::qMenuApply := QMenu():new() - // - qAct := QAction():new( ::qMenuApply ) - qAct:setText( "Apply to Current Tab" ) - ::connect( qAct, "triggered(bool)", {|| ::execEvent( applyMenu_triggered_applyToCurrentTab ) } ) - ::qMenuApply:addAction_4( qAct ) - aadd( ::aApplyAct, qAct ) - // - ::qMenuApply:addSeparator() - // - qAct := QAction():new( ::qMenuApply ) - qAct:setText( "Set as Default" ) - ::connect( qAct, "triggered(bool)", {|| ::execEvent( applyMenu_triggered_setAsDefault ) } ) - ::qMenuApply:addAction_4( qAct ) - ::qMenuApply:addAction_4( qAct ) - aadd( ::aApplyAct, qAct ) - // - ::oUI:q_buttonApply:setMenu( ::qMenuApply ) - #endif - - aeval( ::aThemes, {|e_| ::oUI:q_comboThemes:addItem( e_[ 1 ] ) } ) - aeval( ::aItems , {|e_| ::oUI:q_comboItems:addItem( e_[ 2 ] ) } ) + aeval( ::aThemes, {|e_| ::oUI:q_listThemes:addItem( e_[ 1 ] ) } ) + aeval( ::aItems , {|e_| ::oUI:q_listItems:addItem( e_[ 2 ] ) } ) ::qEdit := ::oUI:q_plainThemeText ::qEdit:setPlainText( GetSource() ) @@ -527,12 +525,14 @@ METHOD IdeThemes:show() ::lCreating := .f. - ::nCurTheme := 1 - ::nCurItem := 1 + ::oUI:q_listThemes:setCurrentRow( 0 ) + ::oUI:q_listItems:setCurrentRow( 0 ) + + //::nCurTheme := 1 + //::nCurItem := 1 ::setTheme() ::setAttributes() - ENDIF RETURN Self @@ -555,8 +555,8 @@ METHOD IdeThemes:copy() aItems := aclone( ::aThemes[ ::nCurTheme ] ) aItems[ 1 ] := cTheme aadd( ::aThemes, aItems ) - ::oUI:qObj[ "comboThemes" ]:addItem( cTheme ) - ::oUI:qObj[ "comboThemes" ]:setCurrentIndex( len( ::aThemes ) - 1 ) + ::oUI:qObj[ "listThemes" ]:addItem( cTheme ) + ::oUI:qObj[ "listThemes" ]:setCurrentRow( len( ::aThemes ) - 1 ) ENDIF RETURN Self @@ -592,6 +592,34 @@ METHOD IdeThemes:setAttributes() /*----------------------------------------------------------------------*/ +METHOD IdeThemes:updateLineNumbersBkColor() + LOCAL oEdit, aAttr + + IF !empty( oEdit := ::oEM:getEditObjectCurrent() ) + aAttr := ::getThemeAttribute( "LineNumbersBkColor", ::aThemes[ ::nCurTheme, 1 ] ) + oEdit:setLineNumbersBkColor( aAttr[ THM_ATR_R ], aAttr[ THM_ATR_G ], aAttr[ THM_ATR_B ] ) + oEdit:refresh() + ::setAttributes() + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + +METHOD IdeThemes:updateCurrentLineColor() + LOCAL oEdit, aAttr + + IF !empty( oEdit := ::oEM:getEditObjectCurrent() ) + aAttr := ::getThemeAttribute( "CurrentLineBackground", ::aThemes[ ::nCurTheme, 1 ] ) + oEdit:setCurrentLineColor( aAttr[ THM_ATR_R ], aAttr[ THM_ATR_G ], aAttr[ THM_ATR_B ] ) + oEdit:refresh() + ::setAttributes() + ENDIF + + RETURN Self + +/*----------------------------------------------------------------------*/ + METHOD IdeThemes:updateColor() LOCAL aAttr, oDlg, qColor, s, aF, aB @@ -624,6 +652,14 @@ METHOD IdeThemes:updateColor() ::setMultiLineCommentRule( ::qHiliter, ::aThemes[ ::nCurTheme, 1 ] ) ::setSyntaxFormat( ::qHiliter, aAttr[ 1 ], aAttr[ 2 ] ) + ELSEIF aAttr[ 1 ] == "CurrentLineBackground" + ::updateCurrentLineColor() + RETURN Self + + ELSEIF aAttr[ 1 ] == "LineNumbersBkColor" + ::updateLineNumbersBkColor() + RETURN Self + ELSE ::setSyntaxFormat( ::qHiliter, aAttr[ 1 ], aAttr[ 2 ] ) @@ -974,7 +1010,7 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "SelectionBackground = Selection Background " ) aadd( aIni, "CurrentLineBackground = Current Line Background " ) aadd( aIni, "UnterminatedStrings = Unterminated Strings " ) - aadd( aIni, "WAPIDictionary = WAPIDictionary " ) + aadd( aIni, "LineNumbersBkColor = Line Numbers Background " ) aadd( aIni, "UserDictionary = UserDictionary " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -993,9 +1029,9 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "UnrecognizedText = 0, 0, 0, No, No, No, " ) aadd( aIni, "BookMarkLineBackground = 0, 255, 255, No, No, No, " ) aadd( aIni, "SelectionBackground = 255, 128, 255, No, No, No, " ) - aadd( aIni, "CurrentLineBackground = 128, 0, 0, No, No, No, " ) + aadd( aIni, "CurrentLineBackground = 255, 215, 155, No, No, No, " ) aadd( aIni, "UnterminatedStrings = 255, 128, 128, No, No, No, " ) - aadd( aIni, "WAPIDictionary = 0, 0, 128, No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 255, 215, 155, No, No, No, " ) aadd( aIni, "UserDictionary = 0, 0, 0, No, No, No, " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -1014,9 +1050,9 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "UnrecognizedText = 0, 0, 0, No, No, No, " ) aadd( aIni, "BookMarkLineBackground = 0, 255, 255, No, No, No, " ) aadd( aIni, "SelectionBackground = 255, 128, 255, No, No, No, " ) - aadd( aIni, "CurrentLineBackground = 128, 0, 0, No, No, No, " ) + aadd( aIni, "CurrentLineBackground = 235, 235, 235, No, No, No, " ) aadd( aIni, "UnterminatedStrings = 255, 128, 128, No, No, No, " ) - aadd( aIni, "WAPIDictionary = 0, 0, 128, No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 235, 235, 235, No, No, No, " ) aadd( aIni, "UserDictionary = 0, 0, 0, No, No, No, " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -1035,9 +1071,9 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "UnrecognizedText = 0,0,0 , No, No, No, " ) aadd( aIni, "BookMarkLineBackground = 0,255,255 , No, No, No, " ) aadd( aIni, "SelectionBackground = 255,128,255 , No, No, No, " ) - aadd( aIni, "CurrentLineBackground = 128,0,0 , No, No, No, " ) + aadd( aIni, "CurrentLineBackground = 220,220,220 , No, No, No, " ) aadd( aIni, "UnterminatedStrings = 255,128,128 , No, No, No, " ) - aadd( aIni, "WAPIDictionary = 0,0,128 , No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 220,220,220 , No, No, No, " ) aadd( aIni, "UserDictionary = 0,0,0 , No, No, No, " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -1058,7 +1094,7 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "SelectionBackground = 255,128,255 , No, No, No, " ) aadd( aIni, "CurrentLineBackground = 0,0,255 , No, No, No, " ) aadd( aIni, "UnterminatedStrings = 255,255,255 , No, No, No, " ) - aadd( aIni, "WAPIDictionary = 0,0,128 , No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 0,0,255 , No, No, No, " ) aadd( aIni, "UserDictionary = 0,0,0 , No, No, No, " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -1077,9 +1113,9 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "UnrecognizedText = 255,255,255 , No, No, No, " ) aadd( aIni, "BookMarkLineBackground = 128,0,255 , No, No, No, " ) aadd( aIni, "SelectionBackground = 0,128,255 , No, No, No, " ) - aadd( aIni, "CurrentLineBackground = 128,255,255 , No, No, No, " ) + aadd( aIni, "CurrentLineBackground = 90,180,180 , No, No, No, " ) aadd( aIni, "UnterminatedStrings = 255,128,64 , No, No, No, " ) - aadd( aIni, "WAPIDictionary = 128,128,64 , No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 90,180,180 , No, No, No, " ) aadd( aIni, "UserDictionary = 0,0,0 , No, No, No, " ) aadd( aIni, " " ) aadd( aIni, " " ) @@ -1098,9 +1134,9 @@ STATIC FUNCTION hbide_loadDefaultThemes() aadd( aIni, "UnrecognizedText = 0,0,0 , No, No, No, " ) aadd( aIni, "BookMarkLineBackground = 0,255,255 , No, No, No, " ) aadd( aIni, "SelectionBackground = 255,0,255 , No, No, No, " ) - aadd( aIni, "CurrentLineBackground = 128,0,0 , No, No, No, " ) + aadd( aIni, "CurrentLineBackground = 220,220,110 , No, No, No, " ) aadd( aIni, "UnterminatedStrings = 128,128,0 , No, No, No, " ) - aadd( aIni, "WAPIDictionary = 0,0,128 , No, No, No, " ) + aadd( aIni, "LineNumbersBkColor = 220,220,110 , No, No, No, " ) aadd( aIni, "UserDictionary = 0,0,0 , No, No, No, " ) aadd( aIni, " " ) ENDIF @@ -1126,7 +1162,7 @@ SelectionBackground = Selection Background 255,128,255 255,128,255 CurrentLineBackground = Current Line Background 128,0,0 0,0,255 128,255,255 128,0,0 UnrecognizedText = Unrecognized Text 0,0,0 255,255,255 255,255,255 0,0,0 UnterminatedStrings = Unterminated Strings 255,128,128 255,255,255 255,128,64 128,128,0 -WAPIDictionary = WAPIDictionary 0,0,128 0,0,128 128,128,64 0,0,128 +LineNumbersBkColor = WAPIDictionary 0,0,128 0,0,128 128,128,64 0,0,128 UserDictionary = UserDictionary 0,0,0 0,0,0 0,0,0 0,0,0 #endif diff --git a/harbour/contrib/hbide/resources/themesex.ui b/harbour/contrib/hbide/resources/themesex.ui index 4a2e53005a..30729b2338 100644 --- a/harbour/contrib/hbide/resources/themesex.ui +++ b/harbour/contrib/hbide/resources/themesex.ui @@ -6,8 +6,8 @@ 0 0 - 438 - 402 + 423 + 507 @@ -23,17 +23,11 @@ - Theme + Theme: - - - - - - - + @@ -46,10 +40,73 @@ - - + + + + + 150 + 170 + + + + + 150 + 170 + + + - + + + + + 0 + 170 + + + + + 16777215 + 170 + + + + + + + + Bold + + + + + + + Italic + + + + + + + Underline + + + + + + + Qt::Vertical + + + + 32 + 63 + + + + + @@ -62,95 +119,85 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 50 - 20 - - - - - - + + - Bold + Preview: - - - - Italic - - + + - - - - Underline - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 120 - 20 - - - - - - - - Qt::Horizontal - - - - + Save - + Save As - + Copy - - + + + + Qt::Vertical + + + + 20 + 26 + + + + + + - Action + SetAsDefault - + + + + ApplyCurrent + + + + + + + ApplyAll + + + + + + + Qt::Vertical + + + + 20 + 24 + + + + + Close diff --git a/harbour/contrib/hbide/resources/themesex.uic b/harbour/contrib/hbide/resources/themesex.uic index 6b972ea46a..6b20d4143d 100644 --- a/harbour/contrib/hbide/resources/themesex.uic +++ b/harbour/contrib/hbide/resources/themesex.uic @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading ui file 'themesex.ui' ** -** Created: Tue Mar 2 16:06:43 2010 -** by: Qt User Interface Compiler version 4.5.3 +** Created: Wed Mar 10 22:01:39 2010 +** by: Qt User Interface Compiler version 4.5.2 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! ********************************************************************************/ @@ -15,11 +15,10 @@ #include #include #include -#include -#include #include #include #include +#include #include #include #include @@ -32,28 +31,31 @@ class Ui_FormThemes public: QGridLayout *gridLayout; QLabel *labelTheme; - QComboBox *comboThemes; - QPlainTextEdit *plainThemeText; QLabel *labelItems; - QComboBox *comboItems; - QPushButton *buttonColor; - QSpacerItem *horizontalSpacer; + QListWidget *listThemes; + QListWidget *listItems; QCheckBox *checkBold; QCheckBox *checkItalic; QCheckBox *checkUnderline; - QSpacerItem *horizontalSpacer_2; - QFrame *lineSep; + QSpacerItem *verticalSpacer_3; + QPushButton *buttonColor; + QLabel *labelPreview; + QPlainTextEdit *plainThemeText; QPushButton *buttonSave; QPushButton *buttonSaveAs; QPushButton *buttonCopy; + QSpacerItem *verticalSpacer; + QPushButton *buttonDefault; QPushButton *buttonApply; + QPushButton *buttonApplyAll; + QSpacerItem *verticalSpacer_2; QPushButton *buttonClose; void setupUi(QWidget *FormThemes) { if (FormThemes->objectName().isEmpty()) FormThemes->setObjectName(QString::fromUtf8("FormThemes")); - FormThemes->resize(438, 402); + FormThemes->resize(423, 507); gridLayout = new QGridLayout(FormThemes); gridLayout->setObjectName(QString::fromUtf8("gridLayout")); labelTheme = new QLabel(FormThemes); @@ -62,87 +64,103 @@ public: gridLayout->addWidget(labelTheme, 0, 0, 1, 1); - comboThemes = new QComboBox(FormThemes); - comboThemes->setObjectName(QString::fromUtf8("comboThemes")); - - gridLayout->addWidget(comboThemes, 0, 1, 1, 8); - - plainThemeText = new QPlainTextEdit(FormThemes); - plainThemeText->setObjectName(QString::fromUtf8("plainThemeText")); - - gridLayout->addWidget(plainThemeText, 1, 0, 1, 9); - labelItems = new QLabel(FormThemes); labelItems->setObjectName(QString::fromUtf8("labelItems")); labelItems->setMaximumSize(QSize(40, 16777215)); - gridLayout->addWidget(labelItems, 2, 0, 1, 1); + gridLayout->addWidget(labelItems, 0, 1, 1, 1); - comboItems = new QComboBox(FormThemes); - comboItems->setObjectName(QString::fromUtf8("comboItems")); + listThemes = new QListWidget(FormThemes); + listThemes->setObjectName(QString::fromUtf8("listThemes")); + listThemes->setMinimumSize(QSize(150, 170)); + listThemes->setMaximumSize(QSize(150, 170)); - gridLayout->addWidget(comboItems, 2, 1, 1, 6); + gridLayout->addWidget(listThemes, 1, 0, 5, 1); + + listItems = new QListWidget(FormThemes); + listItems->setObjectName(QString::fromUtf8("listItems")); + listItems->setMinimumSize(QSize(0, 170)); + listItems->setMaximumSize(QSize(16777215, 170)); + + gridLayout->addWidget(listItems, 1, 1, 5, 1); + + checkBold = new QCheckBox(FormThemes); + checkBold->setObjectName(QString::fromUtf8("checkBold")); + + gridLayout->addWidget(checkBold, 1, 2, 1, 1); + + checkItalic = new QCheckBox(FormThemes); + checkItalic->setObjectName(QString::fromUtf8("checkItalic")); + + gridLayout->addWidget(checkItalic, 2, 2, 1, 1); + + checkUnderline = new QCheckBox(FormThemes); + checkUnderline->setObjectName(QString::fromUtf8("checkUnderline")); + + gridLayout->addWidget(checkUnderline, 3, 2, 1, 1); + + verticalSpacer_3 = new QSpacerItem(32, 63, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(verticalSpacer_3, 4, 2, 1, 1); buttonColor = new QPushButton(FormThemes); buttonColor->setObjectName(QString::fromUtf8("buttonColor")); buttonColor->setMaximumSize(QSize(120, 16777215)); - gridLayout->addWidget(buttonColor, 2, 7, 1, 2); + gridLayout->addWidget(buttonColor, 5, 2, 1, 1); - horizontalSpacer = new QSpacerItem(50, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); + labelPreview = new QLabel(FormThemes); + labelPreview->setObjectName(QString::fromUtf8("labelPreview")); - gridLayout->addItem(horizontalSpacer, 3, 0, 1, 1); + gridLayout->addWidget(labelPreview, 6, 0, 1, 1); - checkBold = new QCheckBox(FormThemes); - checkBold->setObjectName(QString::fromUtf8("checkBold")); + plainThemeText = new QPlainTextEdit(FormThemes); + plainThemeText->setObjectName(QString::fromUtf8("plainThemeText")); - gridLayout->addWidget(checkBold, 3, 1, 1, 2); - - checkItalic = new QCheckBox(FormThemes); - checkItalic->setObjectName(QString::fromUtf8("checkItalic")); - - gridLayout->addWidget(checkItalic, 3, 3, 1, 2); - - checkUnderline = new QCheckBox(FormThemes); - checkUnderline->setObjectName(QString::fromUtf8("checkUnderline")); - - gridLayout->addWidget(checkUnderline, 3, 5, 1, 2); - - horizontalSpacer_2 = new QSpacerItem(120, 20, QSizePolicy::Fixed, QSizePolicy::Minimum); - - gridLayout->addItem(horizontalSpacer_2, 3, 7, 1, 2); - - lineSep = new QFrame(FormThemes); - lineSep->setObjectName(QString::fromUtf8("lineSep")); - lineSep->setFrameShape(QFrame::HLine); - lineSep->setFrameShadow(QFrame::Sunken); - - gridLayout->addWidget(lineSep, 4, 0, 1, 9); + gridLayout->addWidget(plainThemeText, 7, 0, 9, 2); buttonSave = new QPushButton(FormThemes); buttonSave->setObjectName(QString::fromUtf8("buttonSave")); - gridLayout->addWidget(buttonSave, 5, 0, 1, 2); + gridLayout->addWidget(buttonSave, 7, 2, 1, 1); buttonSaveAs = new QPushButton(FormThemes); buttonSaveAs->setObjectName(QString::fromUtf8("buttonSaveAs")); - gridLayout->addWidget(buttonSaveAs, 5, 2, 1, 2); + gridLayout->addWidget(buttonSaveAs, 8, 2, 1, 1); buttonCopy = new QPushButton(FormThemes); buttonCopy->setObjectName(QString::fromUtf8("buttonCopy")); - gridLayout->addWidget(buttonCopy, 5, 4, 1, 2); + gridLayout->addWidget(buttonCopy, 9, 2, 1, 1); + + verticalSpacer = new QSpacerItem(20, 26, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(verticalSpacer, 10, 2, 1, 1); + + buttonDefault = new QPushButton(FormThemes); + buttonDefault->setObjectName(QString::fromUtf8("buttonDefault")); + + gridLayout->addWidget(buttonDefault, 11, 2, 1, 1); buttonApply = new QPushButton(FormThemes); buttonApply->setObjectName(QString::fromUtf8("buttonApply")); - gridLayout->addWidget(buttonApply, 5, 6, 1, 2); + gridLayout->addWidget(buttonApply, 12, 2, 1, 1); + + buttonApplyAll = new QPushButton(FormThemes); + buttonApplyAll->setObjectName(QString::fromUtf8("buttonApplyAll")); + + gridLayout->addWidget(buttonApplyAll, 13, 2, 1, 1); + + verticalSpacer_2 = new QSpacerItem(20, 24, QSizePolicy::Minimum, QSizePolicy::Expanding); + + gridLayout->addItem(verticalSpacer_2, 14, 2, 1, 1); buttonClose = new QPushButton(FormThemes); buttonClose->setObjectName(QString::fromUtf8("buttonClose")); - gridLayout->addWidget(buttonClose, 5, 8, 1, 1); + gridLayout->addWidget(buttonClose, 15, 2, 1, 1); retranslateUi(FormThemes); @@ -153,16 +171,19 @@ public: void retranslateUi(QWidget *FormThemes) { FormThemes->setWindowTitle(QApplication::translate("FormThemes", "Form", 0, QApplication::UnicodeUTF8)); - labelTheme->setText(QApplication::translate("FormThemes", "Theme", 0, QApplication::UnicodeUTF8)); + labelTheme->setText(QApplication::translate("FormThemes", "Theme:", 0, QApplication::UnicodeUTF8)); labelItems->setText(QApplication::translate("FormThemes", "Items:", 0, QApplication::UnicodeUTF8)); - buttonColor->setText(QApplication::translate("FormThemes", "Color", 0, QApplication::UnicodeUTF8)); checkBold->setText(QApplication::translate("FormThemes", "Bold", 0, QApplication::UnicodeUTF8)); checkItalic->setText(QApplication::translate("FormThemes", "Italic", 0, QApplication::UnicodeUTF8)); checkUnderline->setText(QApplication::translate("FormThemes", "Underline", 0, QApplication::UnicodeUTF8)); + buttonColor->setText(QApplication::translate("FormThemes", "Color", 0, QApplication::UnicodeUTF8)); + labelPreview->setText(QApplication::translate("FormThemes", "Preview:", 0, QApplication::UnicodeUTF8)); buttonSave->setText(QApplication::translate("FormThemes", "Save", 0, QApplication::UnicodeUTF8)); buttonSaveAs->setText(QApplication::translate("FormThemes", "Save As", 0, QApplication::UnicodeUTF8)); buttonCopy->setText(QApplication::translate("FormThemes", "Copy", 0, QApplication::UnicodeUTF8)); - buttonApply->setText(QApplication::translate("FormThemes", "Action", 0, QApplication::UnicodeUTF8)); + buttonDefault->setText(QApplication::translate("FormThemes", "SetAsDefault", 0, QApplication::UnicodeUTF8)); + buttonApply->setText(QApplication::translate("FormThemes", "ApplyCurrent", 0, QApplication::UnicodeUTF8)); + buttonApplyAll->setText(QApplication::translate("FormThemes", "ApplyAll", 0, QApplication::UnicodeUTF8)); buttonClose->setText(QApplication::translate("FormThemes", "Close", 0, QApplication::UnicodeUTF8)); Q_UNUSED(FormThemes); } // retranslateUi diff --git a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt index 957db6aa59..b8c12ff33b 100644 --- a/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt +++ b/harbour/contrib/hbqt/doc/en/class_hbqplaintextedit.txt @@ -1,25 +1,20 @@ /* - * hbQTgen v1.0 - Harbour Callable Wrappers Generator for QT v4.5+ - * + * hbQTgen v1.0 - Harbour Callable Wrappers Generator for Qt v4.5.3+ * Please do not modify this document as it is subject to change in future. - * * Pritpal Bedi - * - * 03/10/10 - 19:03:11 - * */ - - /* $DOC$ $TEMPLATE$ Class $NAME$ HBQPlainTextEdit() $CATEGORY$ - Harbour Bindings for Qt 4.5.3+ + Harbour Bindings for Qt $SUBCATEGORY$ GUI + $EXTERNALLINK$ + http://doc.trolltech.com/4.5/hbqplaintextedit.html $ONELINER$ Creates a new HBQPlainTextEdit object. $INHERITS$ @@ -70,6 +65,7 @@ :hbSetCompleter( pCompleter ) -> NIL :hbSetCurrentLineColor( pColor ) -> NIL :hbSetLineAreaBkColor( pColor ) -> NIL + :hbRefresh() -> NIL $DESCRIPTION$ @@ -90,6 +86,6 @@ C++ Wrappers : contrib/hbqt/qtgui/HBQPlainTextEdit.cpp Library : hbqtgui $SEEALSO$ - QPlainTextEdit, http://doc.trolltech.com/4.5/hbqplaintextedit.html + QPlainTextEdit $END$ */ diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 6066d08692..c78f62fd30 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -116,6 +116,11 @@ void HBQPlainTextEdit::hbSetEventBlock( PHB_ITEM pBlock ) block = hb_itemNew( pBlock ); } +void HBQPlainTextEdit::hbRefresh() +{ + update(); +} + void HBQPlainTextEdit::hbShowPrototype( const QString & tip ) { if( tip == ( QString ) "" ) diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h index 82357adce9..95838eb3c5 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.h @@ -163,7 +163,7 @@ public slots: void hbSetCompleter( QCompleter * completer ) { c = completer; }; void hbSetCurrentLineColor( const QColor & color ) { m_currentLineColor = color; }; void hbSetLineAreaBkColor( const QColor & color ) { m_lineAreaBkColor = color; }; - + void hbRefresh(); private slots: void hbSlotCursorPositionChanged(); void hbUpdateLineNumberArea( const QRect &, int ); diff --git a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp index 6000293f7f..be699e34ff 100644 --- a/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp +++ b/harbour/contrib/hbqt/qtgui/HBQPlainTextEdit.cpp @@ -450,6 +450,14 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT_HBSETLINEAREABKCOLOR ) hbqt_par_HBQPlainTextEdit( 1 )->hbSetLineAreaBkColor( *hbqt_par_QColor( 2 ) ); } +/* + * void hbRefresh() + */ +HB_FUNC( QT_HBQPLAINTEXTEDIT_HBREFRESH ) +{ + hbqt_par_HBQPlainTextEdit( 1 )->hbRefresh(); +} + /*----------------------------------------------------------------------*/ #endif /* #if QT_VERSION >= 0x040500 */ diff --git a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg index 9e1105ea66..0dcfe8faa7 100644 --- a/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg +++ b/harbour/contrib/hbqt/qtgui/THBQPlainTextEdit.prg @@ -104,6 +104,7 @@ CREATE CLASS HBQPlainTextEdit INHERIT HbQtObjectHandler, QPlainTextEdit METHOD hbSetCompleter( pCompleter ) METHOD hbSetCurrentLineColor( pColor ) METHOD hbSetLineAreaBkColor( pColor ) + METHOD hbRefresh() ENDCLASS @@ -264,3 +265,7 @@ METHOD HBQPlainTextEdit:hbSetCurrentLineColor( pColor ) METHOD HBQPlainTextEdit:hbSetLineAreaBkColor( pColor ) RETURN Qt_HBQPlainTextEdit_hbSetLineAreaBkColor( ::pPtr, hbqt_ptr( pColor ) ) + +METHOD HBQPlainTextEdit:hbRefresh() + RETURN Qt_HBQPlainTextEdit_hbRefresh( ::pPtr ) + diff --git a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth index 196e8bc780..dd6040b7fc 100644 --- a/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth +++ b/harbour/contrib/hbqt/qth/HBQPlainTextEdit.qth @@ -135,6 +135,7 @@ HB_FUNC( QT_HBQPLAINTEXTEDIT ) void hbSetCompleter( QCompleter * completer ) void hbSetCurrentLineColor( const QColor & color ) void hbSetLineAreaBkColor( const QColor & color ) + void hbRefresh()