Page 1 of 1

Change "TodayCircle" on CalendarGadget to square

Posted: Wed Dec 03, 2008 12:26 pm
by graves
Hi,
I've searched for on the forums and none solution. That's the mine:

1. Create a MANIFEST FILE for your application ("application.exe.manifest"). You can copy "VisualDesigner.exe.manifest" from Purebasic folder (with Fred's permission), and change appropiate xml data.

2. Create a RESOURCE SCRIPT FILE ("application.RC")

Code: Select all

#define RT_MANIFEST 24
#define APP_MANIFEST 1

APP_MANIFEST RT_MANIFEST "application.exe.manifest"
3. Compile your application with "/resource application.RC" command switch activate.

Now your CalendarGadget sound like squares (on XP and 2003 and perhaps, Vista)

Method #2 - NOT TESTED - Using mt.exe (if you have it on "Program Files\Microsoft Visual Studio 8\VC\Bin")
The mt.exe tool can be used to embed an input file as a native manifest resource into an already-built .exe file.

mt.exe -manifest application.exe.manifest -outputresource:application.exe;#1



That's all guys.

Posted: Thu Dec 04, 2008 1:56 pm
by Shardik
You can switch the today marking between circle and square with much less effort. Simply enable or disable in the IDE menu in "Compiler/Compiler Options..." the checkbox for "Enable XP skin support":

XP skin support enabled: today marking is a square
XP skin support disabled: today marking is a circle

Posted: Thu Dec 04, 2008 3:38 pm
by Shardik
Unfortunately I haven't found a solution to change the today marker from square to circle and back during execution. In the following example only the skin of the buttons "<" and ">" is changed:

Code: Select all

LibraryID = OpenLibrary(#PB_Any, ProgramFilename())

If FindResource_(LibraryID(LibraryID), 1, #RT_MANIFEST) = 0
  MessageRequester("Switch gadget's XP style", "It makes only sense to test this example with XP skin enabled!" + #CR$ + "Please enable XP skin in 'Compiler/Compiler Options...'" + #CR$ + "and restart this program!", #MB_ICONEXCLAMATION)
  End
EndIf

XPStyle = #True

If OpenWindow(0, 0, 0, 220, 230, "Switch gadget's XP style", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CompilerIf #PB_Compiler_Version < 430
    CreateGadgetList(WindowID(0))
  CompilerEndIf

  CalendarGadget(0, 10, 10, 200, 180)
  ButtonGadget(1, 10, 200, 200, 20, "Switch XP style") 

  Repeat
    WindowEvent = WaitWindowEvent()

    If WindowEvent = #PB_Event_Gadget
      If EventGadget() = 1
        If XPStyle
          SetWindowTheme_(GadgetID(0), @" ", @" ")
          XPStyle = #False
        Else         
          SetWindowTheme_(GadgetID(0), 0, 0)
          XPStyle = #True
        EndIf
      EndIf
    EndIf
  Until WindowEvent = #PB_Event_CloseWindow
EndIf
Does someone know a solution to also change the today marker on the fly?