The new beta version is now available for download on your personal user account.
Please test it a lot, as there have been quite a few compiler changes.
This is a bug-fix release only, so there is not much new stuff (only 2 commands),
but it fixes some important bugs.
There will be a bug-fix release for the Linux version soon as well.
Timo
Changes:
Help for the 2 new commands:- Added: CalendarGadget() and DateGadget(), thanks to Fr34k !
- Added: Doubleclick on windows background now generate an event (Thanks to Rings)
- Added: LibraryID()
- Added: SaveSprite() now have an optional 'Flags' parameter and can now save 8 bits sprite/screen
- Optimized: ListCount() and ListIndex() are now very fast (it doesn't iterate each element of the list anymore).
- Changed: DeleteElement() now always goes back to the previous element (can be outside the list if
it was the first element), to be fully compatible with ForEach. An optional flag has been added to preserve previous behaviour.
- Changed: the application current directory isn't anymore touched by any PureBasic command to conform
to Windows rules.
- Fixed: IsSound() wasn't available in NT4 mode
- Fixed: AddDate() could fail depending of the computer time zone
- Fixed: Memory leak with linkedlists, arrays and local variables when using a structure which contained strings
- Fixed: SaveSprite() default value for JPEG saving is now '7'.
- Fixed: DisplayPalette() failed on XP systems (1st and last color remained unchanged)
- Fixed: ImageGadget() now supports ToolTips and bitmap/icon live switching
- Fixed: ImageButtonGadget() now supports skinning and bitmap/icon live switching
- Fixed: SetGadgetItemText() for ListViewGadget() destroyed the item user data
- Fixed: CopyImage() failed on WinNT4 under some conditions
- Fixed: A memory leak in SendNetworkFile(). Now, it returns 1 on success or 0 on failure.
- Fixed: StatusBarText() didn't refresh the statusbar with the 'Borderless' flag
- Fixed: CatchImage() with #PB_any
- Fixed: the PNG decoder nows handle corrupted PNG safely
- Fixed: the JPEG encoder with quality value inferior to 3 could lead to a crash
- Fixed: a little TreeGadget() bug when checkboxes were activated
- Fixed: several compiler bugs
CalendarGadget()
Syntax
CalendarGadget(#Gadget, x, y, Width, Height [, Date [, Flags]])
Description
Create a calendar gadget in the current GadgetList. This gadget displays a month calendar and lets the user select a date. The dates used by this gadget and the commands for it use the same date format as the PB date library. If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. #Gadget will be the number returned by EventGadgetID() command. The Date parameter can optionally be used to select a certain date, if not specified, the current date is selected. You can specify #PB_Calendar_Borderless in the Flags parameter if you want the gadget to be created without a border.
The following commands can be used for this gadget:
- SetGadgetState(): Set the currently displayed date.
- GetGadgetState(): Get the currently displayed date.
Example:
If OpenWindow(0, 0, 0, 220, 200, #PB_Window_SystemMenu|#PB_Window_Screencentered,"CalendarGadget()")
If CreateGadgetList(WindowID())
CalendarGadget(0, 10, 10, 200, 180)
Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf
DateGadget()
Syntax
Result = DateGadget(#Gadget, x, y, Width, Height [, Mask$ [, Date [, Flags]]])
Description
Creates a String gadget in the current GadgetList, in which a date and/or time can be entered. This gadget uses the same date format for its functions as used by the Date library. So you can use for example FormatDate() to display the results you get from GetGadgetState() in a proper format. If #PB_Any is used as '#Gadget' parameter, the new gadget identifier will be returned as 'Result'. #Gadget will be the numeric identifier returned by the EventGadgetID() command.
With the optional Mask$ parameter you can specify the format in which the date can be entered. See FormatDate() for the format of this mask. Important note: The gadget does not support the display of seconds, so if you specify "%ss" in the Mask$ parameter, it will simply be ignored! If you don't specify the mask or specify an empty string, a default mask will be choosen. The mask can be modified with the SetGadgetText() command. With the optional Date parameter you can set the displayed date to any date of your choise. Not specifying it or specifying a 0 value will display the current date. By default, the gadget has a button to display a calendar in which the user can choose a date (see image below). You can change this by specifying #PB_Date_UpDown in the Flags parameter. This will make the gadget display an up/down button that lets the user change the current selected part of the gadget.
The following commands can be used for this gadget:
- SetGadgetState(): Set the currently displayed date.
- SetGadgetText(): Change the input mask of the gadget.
- SetGadgetAttribute(): Set a minimum/maximum date that the user can choose.
- GetGadgetState(): Get the currently displayed date.
- GetGadgetText(): Get the current displayed date as a string, as it is displayed in the gadget.
- GetGadgetAttribute(): Get the minimum/maximum date for the gadget.
Example:
If OpenWindow(0, 0, 0, 200, 250, #PB_Window_SystemMenu|#PB_Window_Screencentered,"DateGadget()")
If CreateGadgetList(WindowID())
DateGadget(0, 10, 10, 180, 25, "Date: %mm/%dd/%yyyy Time: %hh:%ii")
Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
EndIf