• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

ROTATING KNOB (gauge)

Started by Patrice Terrier, March 19, 2010, 06:56:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

WinLIFT allows you to create rotating knobs.

The Gauge project, included in the ZIP file attached to the first post of the main WinLIFT thread, shows you the inter-action between several knob gauges.

Here is the declaration of skKnobGauge API:
' // 4.76 Create a Knob gauge control.
 DECLARE FUNCTION skKnobGauge LIB "WinLIFT.dll" ALIAS "skKnobGauge" ( _
 BYVAL hOwner AS LONG, _            ' Handle of the window parent owner.
 zFullpathImageName AS ASCIIZ, _    ' Full path name to the gauge image.
 BYVAL x AS LONG, _                 ' X location of the gauge control.
 BYVAL y AS LONG, _                 ' Y location of the gauge control.
 BYVAL W AS LONG, _                 ' Width of the gauge control.
 BYVAL H AS LONG, _                 ' Height of the gauge control.
 BYVAL ButID AS LONG, _             ' Unique ID of the gauge control.
 BYVAL MinValue AS LONG, _          ' MAXIMUM range value (the exclusion zone is between the MINIMUM and MAXIMUM range).
 BYVAL MaxValue AS LONG, _          ' MAXIMUM range value (the exclusion zone is between the MINIMUM and MAXIMUM range).
 BYVAL UsePos AS LONG, _            ' 0 or initial angle value in degree to use.
 BYVAL StateMax AS LONG _           ' 0 or 2
 ) AS LONG

'// 4.76 Assign the Min/Max gauge value.
 DECLARE SUB skGaugeSetMinMax LIB "WinLIFT.dll" ALIAS "skGaugeSetMinMax" ( _
 BYVAL hCtrl AS LONG, _             ' The control handle.
 BYVAL nMin AS LONG, _              ' Minimum value (for knob this must be a rotation angle in the range 0-359).
 BYVAL nMax AS LONG _               ' Maximum value (for knob this must be a rotation angle in the range 0-359).
 )

'// 4.76 Retrieve the Min/Max gauge value.
 DECLARE SUB skGaugeGetMinMax LIB "WinLIFT.dll" ALIAS "skGaugeGetMinMax" ( _
 BYVAL hCtrl AS LONG, _             ' The control handle.
 BYREF nMin AS LONG, _              ' Minimum value (for knob this is a rotation angle in the range 0-359).
 BYREF nMax AS LONG _               ' Maximum value (for knob this is a rotation angle in the range 0-359).
 )

'// 4.76 Set the gauge value.
 DECLARE SUB skGaugeSetPos LIB "WinLIFT.dll" ALIAS "skGaugeSetPos" ( _
 BYVAL hCtrl AS LONG, _             ' The control handle.
 BYVAL nPos AS LONG, _              ' The pos value to set (must be an angle in the range 0-359 for Knob control).
 BYVAL RedrawFlag AS LONG _         ' Redraw boolean flag.
 )

'// 4.76 Get the gauge value.
 DECLARE FUNCTION skGaugeGetPos LIB "WinLIFT.dll" ALIAS "skGaugeGetPos" ( _
 BYVAL hCtrl AS LONG _              ' The control handle.
 ) AS LONG



Screen shot:



...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#1
The GDImage graphic library has a new API to use the WinLIFT background in composited mode.

The declaration of the new ZI_UseWinLIFTbackground API is:
'// 5.15 Enable/Disable drawing of the WinLIFT skin background in the specified GDImage graphic control.
 DECLARE SUB ZI_UseWinLIFTbackground LIB "GDIMAGE.DLL" ALIAS "ZI_UseWinLIFTbackground" ( _
 BYVAL hGDImageCtrl AS LONG, _ ' The GDimage control handle.
 BYVAL TrueOrFalse AS LONG, _  ' The enable/disable boolean value to use.
 BYVAL RedrawParent AS LONG _  ' TRUE causes immediate redraw of the object parent.
 )


The Gauge project (in the ZIP file attached to the first post of the main WinLIFT thread) has been updated with a new CheckBox, to enable/disable the drawing of the background behind the GDImage graphic control (composited mode).

Screen shot:


I have kept the thin border drawn around the graphic control to let you see the frontier between WinLIFT and GDImage.

ZI_UseWinLIFTbackground allows you to mix "standard" controls and WinLIFT widgets (like in the dashboard project) to create amazing interface for touch screen applications or graphic instrument panel.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com