$PBExportHeader$n_svc_theme.sru $PBExportComments$Theme manager and XP helper forward global type n_svc_theme from n_svc_base end type end forward shared variables string ss_currenttheme str_theme sstr_current end variables global type n_svc_theme from n_svc_base end type global n_svc_theme n_svc_theme type prototypes Function Long SetWindowTheme( uLong hwnd, Ref String pszSubAppName, ref String pszSubIdList ) Library "UxTheme.dll" Alias for "SetWindowTheme" Function Long SetWindowTheme( uLong hwnd, Ref Blob pszSubAppName, ref Blob pszSubIdList ) Library "UxTheme.dll" Alias for "SetWindowTheme" Function uLong GetWindowTheme( uLong hwnd ) Library "UxTheme.dll" Alias for "GetWindowTheme" Function Boolean IsThemeActive() Library "UxTheme.dll" Function Boolean IsThemePartDefined( uLong hTheme, Int iPartId, Int iStateId ) Library "UxTheme.dll" Function Boolean IsAppThemed() Library "UxTheme.dll" Function uLong GetCurrentThemeName( Ref String pszThemeFileName, long dwMaxNameChars, Ref String pszColorBuff, Long cchMaxColorChars, Ref String pszSizeBuff, Long cchMaxSizeChars ) Library "UxTheme.dll" Function uLong GetCurrentThemeName( Ref Blob pszThemeFileName, long dwMaxNameChars, Ref Blob pszColorBuff, Long cchMaxColorChars, Ref Blob pszSizeBuff, Long cchMaxSizeChars ) Library "UxTheme.dll" Function uLong GetThemeColor( uLong hTheme, Int iPartId, Int iStateId, Int iPropId, Ref Long pColor ) Library "UxTheme.dll" Function uLong GetThemeInt( uLong hTheme, Int iPartId, Int iStateId, Int iPropId, Ref Integer piVal ) Library "UxTheme.dll" Function uLong GetThemeEnumValue( uLong hTheme, Int iPartId, Int iStateId, Int iPropId, Ref Integer piVal ) Library "UxTheme.dll" Function uLong GetThemeFont( uLong hTheme, uLong hdc, Int iPartId, Int iStateId, Int iPropId, Ref logfont pFont ) Library "UxTheme.dll" Function uLong GetThemePartSize( uLong hTheme, uLong hdc, Int iPartId, Int iStateId, uLong prc, Integer eSize, Ref tagSize psz ) Library "UxTheme.dll" Function uLong OpenThemeData( uLong hWnd, Ref String pszClassList ) Library "UxTheme.dll" Function uLong OpenThemeData( uLong hWnd, Ref Blob pszClassList ) Library "UxTheme.dll" Function uLong CloseThemeData( uLong hTheme ) Library "UxTheme.dll" end prototypes type variables protected: CONSTANT long BORDERCOLOR = 3801 end variables forward prototypes public function unsignedlong of_opentheme (string as_classlist) public subroutine of_setcurrenttheme () public function string of_getcurrentheme () public subroutine of_setwindowtheme (readonly unsignedlong aul_handle, string as_subappname, string as_subidlist) public function long of_getthemecolor (readonly string as_classlist, integer ai_partid, integer ai_stateid, integer ai_propid) public function long of_getbordercolor (ref n_svc_mgr anv_svc) public function long of_getthemecolor (ref n_svc_mgr anv_svc, readonly string as_classname, readonly long al_part) public function str_theme of_gettheme (readonly integer ai_theme) public function str_theme of_gettheme () public subroutine of_settheme (readonly integer ai_theme) public function long of_gettabbordercolor (ref n_svc_mgr anv_svc) end prototypes public function unsignedlong of_opentheme (string as_classlist);uLong lul_Null, lul_Theme SetNull( lul_Null ) lul_Theme = OpenThemeData( lul_Null, as_ClassList ) Return lul_Theme end function public subroutine of_setcurrenttheme ();String ls_Null ss_CurrentTheme = Space( 256 ) SetNull( ls_Null ) GetCurrentThemeName(ss_CurrentTheme, 256, ls_Null, 0, ls_Null, 0 ) end subroutine public function string of_getcurrentheme ();IF (ss_CurrentTheme = CString.Empty) THEN of_SetCurrentTheme() END IF RETURN ss_CurrentTheme end function public subroutine of_setwindowtheme (readonly unsignedlong aul_handle, string as_subappname, string as_subidlist);SetWindowTheme( aul_Handle, as_SubAppName, as_SubIdList ) end subroutine public function long of_getthemecolor (readonly string as_classlist, integer ai_partid, integer ai_stateid, integer ai_propid);Long ll_Color uLong lul_Null, lul_Theme String ls_ClassList ls_ClassList = as_classlist lul_Theme = of_OpenTheme( ls_ClassList ) If lul_Theme > 0 Then GetThemeColor( lul_Theme, ai_PartId, ai_StateId, ai_PropId, ll_Color ) CloseThemeData( lul_Theme ) End If Return ll_Color end function public function long of_getbordercolor (ref n_svc_mgr anv_svc);RETURN of_GetThemeColor(anv_svc, "Listview", BORDERCOLOR) end function public function long of_getthemecolor (ref n_svc_mgr anv_svc, readonly string as_classname, readonly long al_part);long ll_ret n_svc_system lnv_sys anv_svc.of_LoadSvc(lnv_sys, CSvc.SYS) TRY IF lnv_sys.of_IsSysThemed() THEN of_SetCurrentTheme() ll_ret = of_GetThemeColor(as_classname, 1, 1, al_part) ELSE ll_ret = CColor.APPLICATION_WORKSPACE END IF CATCH (Exception ex) ll_ret = CColor.APPLICATION_WORKSPACE END TRY RETURN ll_ret end function public function str_theme of_gettheme (readonly integer ai_theme);str_theme lstr CHOOSE CASE ai_theme CASE 1 //XP blue lstr.ThemeID = 1 lstr.ToolbarBackground = RGB(159, 191, 245) lstr.Window = RGB(196, 218, 250) lstr.ToolbarGradientStart = RGB(221, 236, 254) lstr.ToolbarGradientEnd = RGB(129, 169, 226) lstr.ToolbarBorder = RGB(59, 97, 156) lstr.ToolbarGripper1 = RGB(39, 65, 118) lstr.ToolbarGripper2 = RGB(255, 255, 255) lstr.ToolbarSeparator1 = RGB(106, 140, 203) lstr.ToolbarSeparator2 = RGB(241, 249, 255) lstr.ButtonBorder = RGB(0, 0, 128) lstr.HotGradientStart = RGB(255, 242, 200) lstr.HotGradientEnd = RGB(255, 208, 145) lstr.PressedGradientStart = RGB(254, 145, 78) lstr.PressedGradientEnd = RGB(255, 211, 142) lstr.CheckedGradientStart = RGB(255, 211, 142) lstr.CheckedGradientEnd = RGB(254, 145, 78) lstr.PanelGradientStart = RGB(89, 135, 214) lstr.PanelGradientEnd = RGB(0, 45, 150) lstr.ToolbarEndGradientStart = RGB(117, 166, 241) lstr.ToolbarEndGradientEnd = RGB(6, 59, 150) lstr.PanelBorderColor = lstr.ToolbarBorder lstr.TextColor = CColor.BLACK lstr.ListViewBackgroundNormal = RGB(235, 234, 219) lstr.ListviewLine1Normal = RGB(226, 222, 205) lstr.ListviewLine2Normal = RGB(214, 210, 194) lstr.ListviewLine3Normal = RGB(203, 199, 184) lstr.ListViewBackgroundHot = RGB(250, 248, 243) lstr.ListviewLine1Hot = RGB(248, 169, 0) lstr.ListviewLine2Hot = RGB(246, 196, 86) lstr.ListviewLine3Hot = RGB(249, 177, 25) lstr.ListviewSeparator1 = RGB(199, 197, 178) lstr.ListviewSeparator2 = RGB(255, 255, 255) CASE 2 //XP Green lstr.ThemeID = 2 lstr.ToolbarBackground = RGB(217, 217, 168) lstr.Window = RGB(242, 241, 228) lstr.ToolbarGradientStart = RGB(244, 247, 222) lstr.ToolbarGradientEnd = RGB(183, 198, 145) lstr.ToolbarBorder = RGB(96, 128, 88) lstr.ToolbarGripper1 = RGB(81, 94, 51) lstr.ToolbarGripper2 = RGB(255, 255, 255) lstr.ToolbarSeparator1 = RGB(96, 128, 88) lstr.ToolbarSeparator2 = RGB(244, 247, 222) lstr.ButtonBorder = RGB(63, 93, 56) lstr.HotGradientStart = RGB(255, 242, 200) lstr.HotGradientEnd = RGB(255, 208, 145) lstr.CheckedGradientStart = RGB(255, 211, 142) lstr.CheckedGradientEnd = RGB(254, 145, 78) lstr.PressedGradientStart = RGB(254, 145, 78) lstr.PressedGradientEnd = RGB(255, 211, 142) lstr.PanelGradientStart = RGB(175, 192, 130) lstr.PanelGradientEnd = RGB(99, 122, 68) lstr.ToolbarEndGradientStart = RGB(176, 194, 140) lstr.ToolbarEndGradientEnd = RGB(99, 122, 107) lstr.PanelBorderColor = lstr.ToolbarBorder lstr.TextColor = CColor.BLACK lstr.ListViewBackgroundNormal = RGB(235, 234, 219) lstr.ListviewLine1Normal = RGB(226, 222, 205) lstr.ListviewLine2Normal = RGB(214, 210, 194) lstr.ListviewLine3Normal = RGB(203, 199, 184) lstr.ListViewBackgroundHot = RGB(250, 248, 243) lstr.ListviewLine1Hot = RGB(227, 150, 88) lstr.ListviewLine2Hot = RGB(227, 145, 79) lstr.ListviewLine3Hot = RGB(207, 114, 37) lstr.ListviewSeparator1 = RGB(199, 197, 178) lstr.ListviewSeparator2 = RGB(255, 255, 255) CASE 3 //XP Silver lstr.ThemeID = 3 lstr.ToolbarBackground = RGB(215, 215, 229) lstr.Window = RGB(243, 243, 247) lstr.ToolbarGradientStart = RGB(243, 244, 250) lstr.ToolbarGradientEnd = RGB(153, 151, 181) lstr.ToolbarBorder = RGB(124, 124, 148) lstr.ToolbarGripper1 = RGB(84, 84, 117) lstr.ToolbarGripper2 = RGB(255, 255, 255) lstr.ToolbarSeparator1 = RGB(110, 109, 143) lstr.ToolbarSeparator2 = RGB(255, 255, 255) lstr.ButtonBorder = RGB(75, 75, 111) lstr.HotGradientStart = RGB(255, 242, 200) lstr.HotGradientEnd = RGB(255, 208, 145) lstr.CheckedGradientStart = RGB(255, 211, 142) lstr.CheckedGradientEnd = RGB(254, 145, 78) lstr.PressedGradientStart = RGB(254, 145, 78) lstr.PressedGradientEnd = RGB(255, 211, 142) lstr.PanelGradientStart = RGB(168, 167, 191) lstr.PanelGradientEnd = RGB(113, 112, 145) lstr.ToolbarEndGradientStart = RGB(179, 178, 200) lstr.ToolbarEndGradientEnd = RGB(121, 119, 148) lstr.PanelBorderColor = lstr.ToolbarBorder lstr.TextColor = CColor.BLACK lstr.ListViewBackgroundNormal = RGB(249, 250, 253) lstr.ListviewLine1Normal = RGB(230, 231, 239) lstr.ListviewLine2Normal = RGB(209, 210, 222) lstr.ListviewLine3Normal = RGB(189, 190, 206) lstr.ListViewBackgroundHot = RGB(254, 254, 254) lstr.ListviewLine1Hot = RGB(249, 169, 0) lstr.ListviewLine2Hot = RGB(246, 196, 86) lstr.ListviewLine3Hot = RGB(249, 177, 25) lstr.ListviewSeparator1 = RGB(181, 182, 200) lstr.ListviewSeparator2 = RGB(254, 254, 254) CASE 4 //Undefined-Theme lstr.ThemeID = 4 lstr.ToolbarBackground = RGB(244, 242, 245) lstr.Window = RGB(251, 250, 251) lstr.ToolbarGradientStart = RGB(250, 250, 250) lstr.ToolbarGradientEnd = RGB(235, 233, 237) lstr.ToolbarBorder = RGB(238, 237, 240) lstr.ToolbarGripper1 = RGB(189, 188, 191) lstr.ToolbarGripper2 = RGB(255, 255, 255) lstr.ToolbarSeparator1 = RGB(193, 193, 196) lstr.ToolbarSeparator2 = RGB(244, 247, 222) lstr.ButtonBorder = RGB(51, 94, 168) lstr.HotGradientStart = RGB(194, 207, 229) lstr.HotGradientEnd = RGB(194, 207, 229) lstr.PressedGradientStart = RGB(153, 175, 212) lstr.PressedGradientEnd = RGB(153, 175, 212) lstr.CheckedGradientStart = RGB(153, 175, 212) lstr.CheckedGradientEnd = RGB(153, 175, 212) lstr.PanelGradientStart = RGB(167, 166, 170) lstr.PanelGradientEnd = RGB(167, 166, 170) lstr.ToolbarEndGradientStart = RGB(189, 189, 192) lstr.ToolbarEndGradientEnd = RGB(167, 166, 170) lstr.PanelBorderColor = lstr.PanelGradientStart lstr.TextColor = CColor.BLACK lstr.ListViewBackgroundNormal = RGB(255, 255, 255) lstr.ListviewLine1Normal = RGB(255, 255, 255) lstr.ListviewLine2Normal = RGB(255, 255, 255) lstr.ListviewLine3Normal = RGB(222, 222, 223) lstr.ListViewBackgroundHot = RGB(255, 255, 255) lstr.ListviewLine1Hot = RGB(249, 177, 25) lstr.ListviewLine2Hot = RGB(250, 199, 70) lstr.ListviewLine3Hot = RGB(249, 177, 25) lstr.ListviewSeparator1 = RGB(214, 213, 217) lstr.ListviewSeparator2 = RGB(255, 255, 255) CASE 5 //Hybrid XP blue/Undefined lstr.ThemeID = 5 lstr.ToolbarBackground = RGB(244, 242, 245) lstr.Window = RGB(251, 250, 251) lstr.ToolbarGradientStart = RGB(250, 250, 250) lstr.ToolbarGradientEnd = RGB(225, 223, 227) lstr.ToolbarBorder = RGB(238, 237, 240) lstr.ToolbarGripper1 = RGB(189, 188, 191) lstr.ToolbarGripper2 = RGB(255, 255, 255) lstr.ToolbarSeparator1 = RGB(193, 193, 196) lstr.ToolbarSeparator2 = RGB(244, 247, 222) lstr.ButtonBorder = RGB(51, 94, 168) lstr.HotGradientStart = RGB(255, 242, 200) lstr.HotGradientEnd = RGB(255, 208, 145) lstr.PressedGradientStart = RGB(254, 145, 78) lstr.PressedGradientEnd = RGB(255, 211, 142) lstr.CheckedGradientStart = RGB(255, 211, 142) lstr.CheckedGradientEnd = RGB(254, 145, 78) lstr.PanelGradientStart = RGB(89, 135, 214) lstr.PanelGradientEnd = RGB(0, 45, 150) lstr.ToolbarEndGradientStart = RGB(189, 189, 192) lstr.ToolbarEndGradientEnd = RGB(167, 166, 170) lstr.PanelBorderColor = RGB(167, 166, 170) lstr.TextColor = CColor.BLACK lstr.ListViewBackgroundNormal = RGB(235, 234, 219) lstr.ListviewLine1Normal = RGB(226, 222, 205) lstr.ListviewLine2Normal = RGB(214, 210, 194) lstr.ListviewLine3Normal = RGB(203, 199, 184) lstr.ListViewBackgroundHot = RGB(250, 248, 243) lstr.ListviewLine1Hot = RGB(248, 169, 0) lstr.ListviewLine2Hot = RGB(246, 196, 86) lstr.ListviewLine3Hot = RGB(249, 177, 25) lstr.ListviewSeparator1 = RGB(199, 197, 178) lstr.ListviewSeparator2 = RGB(255, 255, 255) END CHOOSE RETURN lstr end function public function str_theme of_gettheme ();IF sstr_current.window <= 0 THEN //get default theme sstr_current = of_GetTheme(1) END IF RETURN sstr_current end function public subroutine of_settheme (readonly integer ai_theme);sstr_current = of_GetTheme(ai_theme) end subroutine public function long of_gettabbordercolor (ref n_svc_mgr anv_svc);RETURN RGB(135, 155, 179) end function on n_svc_theme.create call super::create end on on n_svc_theme.destroy call super::destroy end on
- Sources
- Kodigo
- OpenExplorer
- n_svc_theme.sru
File: n_svc_theme.sru
Size: 13340
Date: Mon, 07 Apr 2008 21:31:39 +0200
Size: 13340
Date: Mon, 07 Apr 2008 21:31:39 +0200
- n_svc_base n_svc_theme(sru)
- of_getbordercolor (ref n_svc_mgr anv_svc) returns long
- of_getcurrentheme () returns string
- of_gettabbordercolor (ref n_svc_mgr anv_svc) returns long
- of_gettheme () returns str_theme
- of_gettheme (readonly integer ai_theme) returns str_theme
- of_getthemecolor (readonly string as_classlist, integer ai_partid, integer ai_stateid, integer ai_propid) returns long
- of_getthemecolor (ref n_svc_mgr anv_svc, readonly string as_classname, readonly long al_part) returns long
- of_opentheme (string as_classlist) returns unsignedlong
- of_setcurrenttheme ()
- of_settheme (readonly integer ai_theme)
- of_setwindowtheme (readonly unsignedlong aul_handle, string as_subappname, string as_subidlist)