Skip to content

Commit

Permalink
Merge pull request #96 from dolphinsmalltalk/blairmc/viewtheme
Browse files Browse the repository at this point in the history
Blairmc/viewtheme
  • Loading branch information
blairmcg committed Feb 27, 2016
2 parents e40d4ce + 6b58f7f commit 52ab677
Show file tree
Hide file tree
Showing 7 changed files with 432 additions and 465 deletions.
10 changes: 9 additions & 1 deletion Core/Object Arts/Dolphin/MVP/Base/ThemeConstants.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"Filed out from Dolphin Smalltalk X6.1"!
"Filed out from Dolphin Smalltalk 7"!

Smalltalk at: #ThemeConstants put: (PoolConstantsDictionary named: #ThemeConstants)!
ThemeConstants at: 'ABS_DOWNDISABLED' put: 16r8!
Expand Down Expand Up @@ -145,6 +145,9 @@ ThemeConstants at: 'GFST_NONE' put: 16r0!
ThemeConstants at: 'GFST_SIZE' put: 16r1!
ThemeConstants at: 'GLPS_CLOSED' put: 16r1!
ThemeConstants at: 'GLPS_OPENED' put: 16r2!
ThemeConstants at: 'GP_BORDER' put: 16r1!
ThemeConstants at: 'GP_LINEHORZ' put: 16r2!
ThemeConstants at: 'GP_LINEVERT' put: 16r3!
ThemeConstants at: 'GT_FONTGLYPH' put: 16r2!
ThemeConstants at: 'GT_IMAGEGLYPH' put: 16r1!
ThemeConstants at: 'GT_NONE' put: 16r0!
Expand Down Expand Up @@ -283,11 +286,14 @@ ThemeConstants at: 'RBS_UNCHECKEDDISABLED' put: 16r4!
ThemeConstants at: 'RBS_UNCHECKEDHOT' put: 16r2!
ThemeConstants at: 'RBS_UNCHECKEDNORMAL' put: 16r1!
ThemeConstants at: 'RBS_UNCHECKEDPRESSED' put: 16r3!
ThemeConstants at: 'RP_BACKGROUND' put: 16r7!
ThemeConstants at: 'RP_BAND' put: 16r3!
ThemeConstants at: 'RP_CHEVRON' put: 16r4!
ThemeConstants at: 'RP_CHEVRONVERT' put: 16r5!
ThemeConstants at: 'RP_GRIPPER' put: 16r1!
ThemeConstants at: 'RP_GRIPPERVERT' put: 16r2!
ThemeConstants at: 'RP_SPLITERVERT' put: 16r8!
ThemeConstants at: 'RP_SPLITTER' put: 16r7!
ThemeConstants at: 'SBP_ARROWBTN' put: 16r1!
ThemeConstants at: 'SBP_GRIPPERHORZ' put: 16r8!
ThemeConstants at: 'SBP_GRIPPERVERT' put: 16r9!
Expand All @@ -309,6 +315,8 @@ ThemeConstants at: 'SCRBS_PRESSED' put: 16r3!
ThemeConstants at: 'SP_GRIPPER' put: 16r3!
ThemeConstants at: 'SP_GRIPPERPANE' put: 16r2!
ThemeConstants at: 'SP_PANE' put: 16r1!
ThemeConstants at: 'SPLITS_NORMAL' put: 16r1!
ThemeConstants at: 'SPLITSV_NORMAL' put: 16r1!
ThemeConstants at: 'SPLS_HOT' put: 16r2!
ThemeConstants at: 'SPLS_NORMAL' put: 16r1!
ThemeConstants at: 'SPLS_PRESSED' put: 16r3!
Expand Down
20 changes: 19 additions & 1 deletion Core/Object Arts/Dolphin/MVP/Base/View.cls
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,8 @@ beDefaultThemed
ThemeLibrary default
setWindowTheme: self handle
pszSubAppName: (self themeSubAppName ifNotNil: [:name | name asUnicodeString])
pszSubIdList: nil!
pszSubIdList: nil.
self openTheme!

beForeground
"Make the receiver the foreground window."
Expand All @@ -427,6 +428,7 @@ beNotThemed
#wineFix.
^self].

self freeTheme.
ThemeLibrary default
setWindowTheme: self handle
pszSubAppName: '' asUnicodeString
Expand Down Expand Up @@ -1323,6 +1325,11 @@ frameWidths

^self class frameWidths: self baseStyle!

freeTheme
"Private - Override point to free any theme related resources"

!

getDC
"Answer a device context to enable drawing on the receiver."

Expand Down Expand Up @@ -2601,6 +2608,11 @@ onZOrderChanged

!

openTheme
"Private - Override point to allocate any theme related resources and query theme metrics"

!

parentPresenter
"Answer the presenter that can be considered the parent of the receiver.
Part of the Presenter protocol used when the receiver is in fact its own presenter"
Expand Down Expand Up @@ -4239,6 +4251,10 @@ wmSysKeyUp: message wParam: wParam lParam: lParam
wmThemeChanged: message wParam: wParam lParam: lParam
"Private - Default handler for a WM_THEMECHANGED message from Windows."

self
freeTheme;
openTheme.
"Let the control see the theme change event too, otherwise it will not change style"
^nil!

wmTimer: message wParam: wParam lParam: lParam
Expand Down Expand Up @@ -4508,6 +4524,7 @@ zOrderTop
!View categoriesFor: #forecolorChanged!private!updating! !
!View categoriesFor: #frameChanged!helpers!private! !
!View categoriesFor: #frameWidths!accessing!public! !
!View categoriesFor: #freeTheme!helpers!private! !
!View categoriesFor: #getDC!accessing!public! !
!View categoriesFor: #getEvents!events!private! !
!View categoriesFor: #getFileLocator!accessing!private! !
Expand Down Expand Up @@ -4688,6 +4705,7 @@ zOrderTop
!View categoriesFor: #onXButtonPressed:!event handling!public! !
!View categoriesFor: #onXButtonReleased:!event handling!public! !
!View categoriesFor: #onZOrderChanged!event handling!public! !
!View categoriesFor: #openTheme!helpers!private! !
!View categoriesFor: #parentPresenter!presenter!public! !
!View categoriesFor: #parentView!hierarchy!public! !
!View categoriesFor: #parentView:!hierarchy!private! !
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"Filed out from Dolphin Smalltalk X6.1"!
"Filed out from Dolphin Smalltalk 7"!

ListControlView subclass: #IconicListAbstract
instanceVariableNames: 'getImageBlock imageManager stateImageManager getInfoTipBlock customDrawBlock largeIconExtent thumbnailsImageManager'
Expand Down Expand Up @@ -48,15 +48,6 @@ basicItemFromPoint: aPoint

^self subclassResponsibility!

beDefaultThemed
OSVERSIONINFO current isWinVista
ifTrue:
[ThemeLibrary default
setWindowTheme: self handle
pszSubAppName: 'explorer' asUnicodeString
pszSubIdList: nil]
ifFalse: [super beDefaultThemed]!

beLargeIcons
"Set the receiver's image extent to that for large icons."

Expand Down Expand Up @@ -714,7 +705,6 @@ wmDestroy: message wParam: wParam lParam: lParam
!IconicListAbstract categoriesFor: #attachEditControl:!private! !
!IconicListAbstract categoriesFor: #basicEditItemLabel:!operations!private! !
!IconicListAbstract categoriesFor: #basicItemFromPoint:!enquiries!private! !
!IconicListAbstract categoriesFor: #beDefaultThemed!modes!public! !
!IconicListAbstract categoriesFor: #beLargeIcons!modes!public! !
!IconicListAbstract categoriesFor: #beSmallIcons!modes!public! !
!IconicListAbstract categoriesFor: #canEditLabels!accessing-styles!public!testing! !
Expand Down
23 changes: 2 additions & 21 deletions Core/Object Arts/Dolphin/MVP/Views/Common Controls/TabViewXP.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"Filed out from Dolphin Smalltalk X6"!
"Filed out from Dolphin Smalltalk 7"!

TabView subclass: #TabViewXP
instanceVariableNames: 'theme lastSelection _tvxReserved1 _tvxReserved2 _tvxReserved3'
Expand All @@ -14,14 +14,6 @@ TabViewXP is needed because the themed control implementation provided by Micros
!TabViewXP categoriesForClass!MVP-Views! !
!TabViewXP methodsFor!

beDefaultThemed
super beDefaultThemed.
self openTheme!

beNotThemed
self freeTheme.
super beNotThemed!

calcClientRectangleFromRectangle: aRectangle
"Private - Given a window rectangle represented by the <Rectangle> argument, answer the
client area that this would provide, taking into account the current window styles etc."
Expand Down Expand Up @@ -383,17 +375,7 @@ wmPrintClient: message wParam: wParam lParam: lParam
handle: handle
wParam: 0
hdc: wParam
paintStruct: nil)]!

wmThemeChanged: message wParam: wParam lParam: lParam
"Private - Default handler for a WM_THEMECHANGED message from Windows."

self
freeTheme;
openTheme.
^0! !
!TabViewXP categoriesFor: #beDefaultThemed!modes!public! !
!TabViewXP categoriesFor: #beNotThemed!modes!public! !
paintStruct: nil)]! !
!TabViewXP categoriesFor: #calcClientRectangleFromRectangle:!geometry!private! !
!TabViewXP categoriesFor: #createVerticalFont!event handling!private! !
!TabViewXP categoriesFor: #freeTheme!helpers!private! !
Expand All @@ -417,5 +399,4 @@ wmThemeChanged: message wParam: wParam lParam: lParam
!TabViewXP categoriesFor: #themeHandle!accessing!private! !
!TabViewXP categoriesFor: #wmPaint:wParam:lParam:!event handling-win32!private! !
!TabViewXP categoriesFor: #wmPrintClient:wParam:lParam:!event handling-win32!private! !
!TabViewXP categoriesFor: #wmThemeChanged:wParam:lParam:!event handling-win32!private! !

11 changes: 1 addition & 10 deletions Core/Object Arts/Dolphin/MVP/Views/MoenTree/MoenTreeView.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"Filed out from Dolphin Smalltalk X6.1"!
"Filed out from Dolphin Smalltalk 7"!

View subclass: #MoenTreeView
instanceVariableNames: 'anchorNode getTextBlock getImageBlock mtvFlags leading imageManager calculatedExtent parentSpacing selection linePen iconExtent maxTextExtent dtFlags margin textInset theme _mtvReserved1 _mtvReserved2'
Expand Down Expand Up @@ -1802,14 +1802,6 @@ wmSetFocus: message wParam: wParam lParam: lParam
^super wmSetFocus: message wParam: wParam lParam: lParam
!

wmThemeChanged: message wParam: wParam lParam: lParam
"Private - Default handler for a WM_THEMECHANGED message from Windows."

self
freeTheme;
openTheme.
^0!

zip: aMoenTreeNode
"Private - Reassemble the contours of the <MoenTreeNode> argument
and its parent chain to accomodate a change in the argument's subtree."
Expand Down Expand Up @@ -1980,7 +1972,6 @@ zip: aMoenTreeNode
!MoenTreeView categoriesFor: #wmKillFocus:wParam:lParam:!event handling-win32!private! !
!MoenTreeView categoriesFor: #wmNcCalcSize:wParam:lParam:!event handling-win32!private! !
!MoenTreeView categoriesFor: #wmSetFocus:wParam:lParam:!event handling-win32!private! !
!MoenTreeView categoriesFor: #wmThemeChanged:wParam:lParam:!event handling-win32!private! !
!MoenTreeView categoriesFor: #zip:!private!tree layout! !

MoenTreeView methodProtocol: #selectableItems attributes: #(#readOnly) selectors: #(#hasSelection #onSelectionChanged #onSelectionChanging: #resetSelection #selection #selection: #selection:ifAbsent: #selectionIfNone: #selectionOrNil #selectionOrNil:)!
Expand Down
Loading

0 comments on commit 52ab677

Please sign in to comment.