WinLIFT version 4.89 is attached to this post.
(updated on august, 09, 2011)
QuoteWe strongly believe that, from the user's point of view, your application's appearance is the biggest single factor that can make the difference between your product and that of your competitors.
This is where WinLIFT comes in, it helps you to make the difference...
List of controls currently supported:
- Border.
- CheckBox.
- ComboBox.
- Dialog (class #32767)
- Edit.
- GroupBox.
- ListBox.
- ListView.
- MenuBar.
- MenuPopup (class #32768).
- PushButton.
- ProgressBar.
- RadioButton.
- Rebar.
- ScrollBar (System).
- SDI popup window.
- Static.
- StatusBar.
- SysHeader.
- System buttons.
- Tab.
- ToolBar.
- ToolTip.
- TrackBar.
- TreeView.
- UpDown.
Exclusive features:
- Composited mode (translucency).
- 100% compatible with the AERO Desktop Window Manager.
- Wallpaper background.
- Anchor mode for child controls.
- Custom icon.
- SKI lossless graphic resource.
- SKS style sheet.
- Border of any size.
- Minimum size preservation, based on the initial size of the window.
- Multiple monitor detection.
- Enhanced modal mode, with grayed disabled window.
- LED status.
- Custom Buttons.
- Built-in tooltip support.
- Clock widget.
- Rotating knob (gauge).
- Full compatibility with the optional GDImage graphic library.
- Static image.
Exclusive Skins:
- Boxer.
- Braun.
- Busi.
- Chrome.
- Crystal.
- Futura.
- Glass.
- Gray.
- Ipod.
- Mint.
- Mito.
- Nokia.
- Podcast.
- Robot.
- Seven
Windows version: XP, Vista, Seven, Windows 8. Version 4.56+ is compatible with FF3.Screen shot of the "Ipod" skin:(http://www.zapsolution.com/pictures/WSA430.jpg)
...
Here is the beta version 4.25 with skinned ScrollBar
(http://www.zapsolution.com/pictures/WSA425.jpg)
Microsoft goes to all extent, to make the skinning of the default scrollbar, one of the most daunting task i have ever done!
For this reason i had to make some changes on the standard behavior, the horizontal scrollbar is using smooth scrolling while dragging the thumb track (un-hold the left mouse button to stop the scrolling asap).
Note: click on the icon eye to change the background.
...
Ipod is the fourth theme designed for the new WinLIFT.
(http://www.zapsolution.com/pictures/Ipod.jpg)
...
Beta version 4.31 completes the skinning of ComboBox.
Now, it should work and look exactly the same on XP, VISTA, and Seven.
(http://www.zapsolution.com/pictures/WSA431.jpg)
Petr--
May i ask you to check the combo button or your CZ computer, because i remember your had a compatibility issue with an older example i posted in the "SDK programming" section.
Thank you.
PS: The new zip file is attached to the first post of this thread.
...
Hi Patrice,
good work, combobox worked without single issue here!
I could not recognize the good old addressbook example under your visual magic for a while.
Then it clicked in my head :)
Petr
WSA has been updated to version 4.34.The ZIP file is attached to the first post of this thread.
What is new in version 4.34:
- WinLIFT exclusive modal mode with disabled grayed parent.
- WinLIFT skDialogAlert.
- WinLIFT skDialogError.
- WinLIFT skDialogInfo.
- WinLIFT skDialogYesNo.
- WinLIFT skDialogInput.
- Skin theme enhancements.
- Colored caret to ensure better visibility in edit control
- New project rvGame (game by Roberto Valois).
To check the different WinLIFT modal dialog, edit the source code of the
Template.bas projetc:
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %IDOK
'CALL skDialogAlert("", "ALERT" + $CR + $CR + $CR + "Displays a modal dialog box that contains a WinLIFT icon, a set of buttons, and a brief application-specific message.", "")
'CALL skDialogError("", "ERROR" + $CR + $CR + $CR + "Displays a modal dialog box that contains a WinLIFT icon, a set of buttons, and a brief application-specific message.", "")
'CALL skDialogInfo("", "INFO" + $CR + $CR + $CR + "Displays a modal dialog box that contains a WinLIFT icon, a set of buttons, and a brief application-specific message.", "")
'CALL skDialogYesNo("", "QUESTION" + $CR + $CR + $CR + "Displays a modal dialog box that contains a WinLIFT icon, a set of buttons, and a brief application-specific message.", "@Yes,No")
CALL skDialogInput("", "INPUT" + $CR + $CR + $CR + "Displays a modal dialog box that contains a WinLIFT icon, a set of buttons, and a brief application-specific message.", "")
(http://www.zapsolution.com/pictures/WSA434.jpg)
...
MiTo
(http://www.zapsolution.com/pictures/Mito.jpg)
My daughter just bought one ;D
...
WinLIFT allows you to fully customize the NonClientArea, as you can see on this screen shot:
(see the width of the translucent border on the right side, while there is none on the left)
(http://www.zapsolution.com/pictures/Futura.png)
Petr,
You know what, that's still the DDT address book application ;D
...
Nice sci-fi look :),
how did WinLift "attached" the right stripes bar to the window?
I am slightly confused by "non client area", it looks like the client one was widened.
Petr,
WinLIFT doesn't alter the client size, never.
However it takes full control of the non-client area, that is the part that most programmers never handle themselves.
One of the message processed by WinLIFT to change the size of the borders drawn around the client area is the WM_NCCALCSIZE message, see MSDN here: http://msdn.microsoft.com/en-us/library/ms632634(VS.85).aspx
It does it that way:
CASE %WM_NCCALCSIZE
IF wParam THEN
IF Win(Item).hMenu THEN
SkinMenuHeight& = skGetSystemMetrics(%SK_CYMENU)
END IF
pNCC = lParam
IF Win(Item).hMdiClient THEN One& = 1
pWP = @pNCC.lppos
@pNCC.rgrc(0).nLeft = @pWP.x + skGetSystemMetrics(%SK_CXFRAMELEFT)
@pNCC.rgrc(0).nTop = @pWP.y + skGetSystemMetrics(%SK_CYCAPTION) + SkinMenuHeight&
@pNCC.rgrc(0).nRight = @pWP.x + @pwP.cx - skGetSystemMetrics(%SK_CXFRAMERIGHT)
@pNCC.rgrc(0).nBottom = @pWP.y + @pwP.cy - skGetSystemMetrics(%SK_CYFRAMEBOTTOM)
' // Anchor child controls
IF UBOUND(gChor) > 0 THEN
FOR K = LBOUND(gChor) TO UBOUND(gChor)
CALL skSetAnchorMode(gChor(K).hWnd, gChor(K).anchor)
NEXT
ERASE gChor()
END IF
END IF
When you write a SkinEngine, you need to learn what each of the Windows message are meant for, and act accordingly.
This is the reason why learning low level SDK is so important when you want to do fancy stuffs, that are out of control from most DotNET and DDT programmers. Learning how to use hook is another important thing to master, as well as subclassing and custom draw.
...
In order to protect those creating their own skin, the new WinLIFT will use a proprietary image format, with non-destructive compression and full 32-bit ARGB.
The name of this new format will have the .SKI extension, and a new command line utility will be provided to convert from standard graphic format.
The syntax to use will be:
ImgToSki i:\WinLIFT\Podcast\Button.png
this will create a new file named i:\WinLIFT\Podcast\Button.ski
Size of Button.png = 4808 bytes
Size of Button.ski = 3828 bytes
...
For those wanting to figure how the SKS works, i would say it works exactly like a CSS file for a HTML page.
...
Mint
(http://www.zapsolution.com/pictures/Mint.png)
...
Chrome
(http://www.zapsolution.com/pictures/Chrome.png)
...
Gray(http://www.zapsolution.com/pictures/Gray.jpg)
Now with:
- Rebar
- Progress bar
- Status bar
...
Braun
(http://www.zapsolution.com/pictures/Braun.jpg)
...
Robot
(http://www.zapsolution.com/pictures/Robot.png)
...
I just checked the latest beta version on XP, and found that there is a big difference in the FONT appearance with VISTA/W7, because the new SkinEngine is using "clear type font", that is not supported by XP.
Thus on XP (only), it is better to change the default font, at the end of the SKS file, from
Trebuchet MS to
MS Sans Serif.
Quote"USEFONT, MS Sans Serif" ' Font to use on VISTA/W7: Trebuchet MS
...
Seven
(http://www.zapsolution.com/pictures/Seven.png)
...
The first post of this thread has been updated to WinLIFT version 4.41 beta.
SysTreeView has been added to complete the first set of controls supported by WinLIFT.
Next step: i shall add a new WinLIFT section on my website :)
I have added in the "TextWSA.zip" a new Bff project to let you check with TreeView.
Screen shot:
(http://www.zapsolution.com/pictures/Bff.png)
...
My first attempt to use WinLift with a script bundled with thinBasic.
I've seen that skInitEngine accept full path to .sks file. Is it ok?
Eros,
".sks" file must be always located into the same folder than the EXE, and the @path@ parameter is always relative to the EXE.
If "background" can't be found then it means that the user are not allowed to change them, and this has been done by design.
Here is an example of what i could do using a new "BACKGROUNDPATH" parameter:
Quote"BACKGROUNDPATH, C:\Users\Public\Pictures\Sample Pictures"
and if this parameter is omitted, then i will still use the defaut: "EXE.Path$ + "Background\""
...
The first post of this thread has been updated to version 4.47.
- You can now use a new "BACKGROUNDPATH" parameter in ".sks" file (see below)
'AUTHOR section -------------------------------------------------------------
"AUTHOR,|Skin design: <Patrice Terrier> E-mail: pterrier@zapsolution.com"
'"BACKGROUNDPATH, C:\Users\Public\Pictures\Sample Pictures"
'BITMAP section -------------------------------------------------------------
"CTLBACK, @PATH@PODCAST\CTLBACK.jpg"
"MENUBAR, @PATH@PODCAST\MENUBAR.ski"
"MENUBACK, @PATH@PODCAST\MENUBAK.ski"
"BUTTON, @PATH@PODCAST\BUTTON.ski"
"CAPTIONL, @PATH@PODCAST\CAPTIONL.ski"
"CAPTIONM, @PATH@PODCAST\CAPTIONM.ski"
"CAPTIONR, @PATH@PODCAST\CAPTIONR.ski"
"SIDEL, @PATH@PODCAST\SIDEL.ski"
"SIDER, @PATH@PODCAST\SIDER.ski"
"RADIOBUT, @PATH@PODCAST\RADIOBUT.ski"
...
Now you can use any of these graphic file extensions for background:
.bmp .png .jpg .tif .gifWhile there is no limit for the upper size of a background, 800 x 600 is still the minimum to look good when the window is maximized.
...
My last baby:
(http://www.zapsolution.com/pictures/Sony.jpg)
...
Done! (see the attached screen shot)
Peter,
Very nice project ;)
Indeed the WM_NOTIFY message (custom draw) was not handled when the LISTVIEW was a child of a TAB control.
...
This is a FF3 TAB control project using the "Silver" skin, in blur-text-behind mode (to enhance the contrast when using color on color)
Screen shot:
(http://www.zapsolution.com/pictures/TABcontrol.png)
...
For your information:
In WinLIFT a STATIC control use a TRANSPARENT background, while an EDIT control use OPAQUE.
However when using the %ES_AUTOHSCROLL + %ES_READONLY style with an EDIT control, Windows doesn't send a %WM_CTLCOLOREDIT, but a %WM_CTLCOLORSTATIC message (causing the havoc reported by Peter).
...
The first post of this thread has been updated to
version 4.59.
New features:
- Support for the UpDown control.
- skButtonImage API, 5-state Image Button (using transparent PNG).
When using 5-state image button, you have to design the button yourself and save it as a transparent png file.
Code Example:
IF skInitEngine("Glass.sks", "") THEN
CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")
CALL skButtonImage(hDlg, EXE.Path$ + "BTN_Play.png", 6, 248, %IDC_IMAGEX1, 0)
END IF
Note: The skButtonImage API uses
pixel coordinates exclusively.
See the attached screen shot
...
Attached to this post you will find a FF3 demo project using both GDImage and WinLIFT.
New: WinLIFT 2.60+ is now compatible with GDImage.
Screen shot:
(http://www.zapsolution.com/pictures/ZoomImage.png)
...
New WinLIFT skin "Macassar"
(http://www.zapsolution.com/pictures/Macassar.jpg)
...
Because WinLIFT install a global hook on the %WM_CREATE message.
You must not link the WinLIFT.dll to your code if you do not want to use it!
To produce both skinned and un-skinned version of the same application, use the compiler directive #IF and #ENDIF like this.
%SKIN_THIS_APPLICATION = 1
...
#IF %SKIN_THIS_APPLICATION
IF skInitEngine("ipod.sks", "") THEN
CALL skSkinWindow(CB.HNDL, "Dock|Undock|Minimize|Maximize|Restore|Close")
END IF
#END IF
Thank you!
...
New WinLIFT skin "Onyx"
(http://www.zapsolution.com/pictures/Onyx.png)
I have also attached a Red variation.
...
really nice Tool!
Thank you!
...
The first post of this thread has been updated to
version 4.61.
New:
- Built-in tooltip support.
- ComboBox enhancement (support for empty ListBox).
Example showing how to use the built-in tooltip support:
IF skInitEngine("ipod.sks", "") THEN
CALL skSkinWindow(hdlg, "Dock|Undock|Minimize|Maximize|Restore|Close")
CALL skCreateToolTip (GetDlgItem(hdlg, %IDC_COMBOBOX1), "ComboBox")
CALL skCreateToolTip (GetDlgItem(hdlg, %IDC_LISTBOX1), "ListBox")
CALL skCreateToolTip (GetDlgItem(hDlg, %IDC_BUTTON1), "Test 123")
CALL skCreateToolTip (GetDlgItem(hDlg, %IDC_CUSTOMCONTROL_1), "XPBUTTON")
CALL skCreateToolTip (GetDlgItem(hdlg, %IDC_MSCTLS_TRACKBAR32_1), "Trackbar 123")
END IF
Note: In order to use the skin theme, skCreateToolTip must be used AFTER the call to skSkinWindowThe new tooltip API are: DECLARE FUNCTION skCreateToolTip LIB "WinLIFT.dll" ALIAS "skCreateToolTip" (BYVAL hObj AS LONG, zText AS ASCIIZ) AS LONG
DECLARE SUB skSetToolTipText LIB "WinLIFT.dll" ALIAS "skSetToolTipText" (BYVAL hObj AS LONG, zText AS ASCIIZ)
DECLARE FUNCTION skGetToolTipText LIB "WinLIFT.dll" ALIAS "skGetToolTipText" (BYVAL hObj AS LONG) AS STRING
...
I don't know if i will be able to complete this or not, however i think it has never been done before (in a SkinEngine) ;D
Full composited crystal mode with custom glass effect, variable opacity, fancy window shape, drop shadow and full anti-alias:
(http://www.zapsolution.com/pictures/wlftwdm.jpg)
...
I will be happy to test it on XPs once it is out ;)
I am in the process to make WinLIFT and GDImage 100% compatible together, and also ensure further DWM compatibility that is the prerequisite to produce the fancy UI i have in mind.
Thus XP niet! ;D
...
And you can add, C, C++, and all the languages that do not superclass the native SDK Windows classes.
Portability, is the result of using low level SDK programming style ;D
...
In theory, the dynamic detection of new control creation should be possible in WinLIFT because i am pre-processing the WM_CREATE message. I shall look at it, once i am done with the DWM support i am working on.
About the "Sony" skin, this one will be part of the first Skin-pack that has not been yet fully completed.
...
Note: This demo requires either VISTA or SEVEN (it won't run on XP)
I made it to show you how close i was to succeed in using the SkinEngine hover a DirectDraw surface.
I have almost everything working, except for the nasty EDIT control that defeat all i have tried.
To see my problem select "Tab page 2" and move the window alternatively hover a light or dark background and look at the EDIT control inside of "Frame 2" (same problem occure with the EDIT section of the ComboBox on "Tab page 3").
The problem with the EDIT control is, that it can't be owner-drawn nor custom-drawn, and Windows re-paint it in so many different places that message subclassing is not reliable with it.
...
DWM means Desktop Window Manager.
It is the desktop graphical user interface system being used in Windows VISTA and Windows SEVEN, it requires graphic cards supporting DirectX 9.0+ and Shader Model 2.0. It works in composited mode (drawing from the bottom to the top of the z-order), and the most obvious part of it, is the transparent border drawn around the windows when you are running in AERO mode.
Usualy the AERO mode works with a BLUR effect, however graphic toolkits like GDImage and WinLIFT are also able to apply a full CRYSTAL mode to a specific window, without changing anything in the registry!
DWM uses DirectX to perform the function of compositing and rendering in the GPU, freeing the CPU of the task of managing the rendering from the off-screen buffers to the display.
Both GDImage and WinLIFT are using DWM in composited mode and they write directly onto the DirectDraw surface when available.
See the CRYSTAL demo in the GDImage section here (http://www.jose.it-berater.org/smfforum/index.php?topic=1372.0)
Added:
I forget to say that graphic libraries based on GDI and container like the DDT "GRAPHIC WINDOW" are unable to work correctly with a DirectDraw surface.
...
On the attached screen shot, all the controls are drawn onto the DWM DirectDraw surface.
It looks like a Layered window, but it is not, because you can use variable opacity and even OPAQUE section.
See also the shadow arround the window and the anti-alias arround the wheels icon.
This makes possible to have an animation playing gently in the background, like in the GDImage "DreamWork" or "WinScape" projects, and you can use transparent png for wallpaper.
...
This is WinLIFT version 4.70, with built-in support for the AERO composited mode on VISTA and SEVEN.
Note: The composited mode is drawing directly onto the "Desktop Window Manager" surface.
For those still running XP, here is a screenshot:
(http://www.zapsolution.com/pictures/wlftcompo.jpg)
Of course you could have also opaque or variable opacity background if you prefer.
...
Quotehow can you adjust the opacity
Adjusting the opacity, was not the purpose of the demo, and it will be probably the easiest part of the work i have done.
See the GDImage Crystal demo or run BassBox in full composited Crystal mode and adjust the "client zone opacity", that could be one way, the other would be to change the PNG background and select a new one, just like you can do it already when you select a new background.
...
Version 4.71 is attached to this post
New features:
- CheckBox support in ListView.
- Color and opacity adjustment in Windows VISTA/SEVEN in AERO mode.
(http://www.zapsolution.com/pictures/WLFT471.jpg)
The "AEROCOLOR" parameter of the sks file, allows you to setup both the color and the opacity of the AERO glass surface.
...
(http://www.zapsolution.com/pictures/skmatrix.jpg)
...
The first post of this thread has been updated with version 4.72, and it is provided with a new project named "Buttons.exe".
The new demo shows you how to use the WinLIFT built-in button(s) API, altogether with the WinLIFT anchor mode.
WinLIFT's button(s) must be used AFTER the skin has been selected like this:
FUNCTION PBMAIN () AS LONG
LOCAL hDlg AS DWORD, hCtrl AS LONG, sResource AS STRING
DIALOG NEW PIXELS, 0, "Buttons",,, 480, 360, %WS_OVERLAPPEDWINDOW, 0 TO hDlg
IF skInitEngine("Sony.sks", "") THEN
CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")
sResource = EXE.Path$ + "Resource\"
hCtrl = skButtonImage(hDlg, sResource + "BTN_Left.png", 216-57, 300+12, %IDC_BTN_LEFT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "BTN_Play.png", 216, 300, %IDC_BTN_PLAY, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "BTN_Right.png", 216+49, 300+12, %IDC_BTN_RIGHT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skPushButtonImage(hDlg, sResource + "Check_32.png", "%BS_LEFT", 20, 20, 140, 50, %IDC_BTN_CHECK, %BS_LEFT)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Delete_32.png", "%BS_CENTER", 20 + 140 + 8, 20, 140, 50, %IDC_BTN_CHECK, %BS_CENTER)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Recycle_32.png", "%BS_RIGHT", 20 + (140 + 8) * 2, 20, 140, 50, %IDC_BTN_CHECK, %BS_RIGHT)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Print_32.png", "%BS_TOP", 20, 20 + 70, 140, 50, %IDC_BTN_PRINT, %BS_TOP)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, "", "WITHOUT IMAGE", 20 + 140 + 8, 20 + 70, 140, 50, %IDC_BTN_TEXT, %BS_CENTER)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "Save_32.png", "%BS_BOTTOM", 20 + (140 + 8) * 2, 20 + 70, 140, 50, %IDC_BTN_SAVE, %BS_BOTTOM)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skButtonImage(hDlg, sResource + "32bit_80.png", 20, 264, %IDC_BTN_32BIT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "64bit_80.png", 380, 264, %IDC_BTN_64BIT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM_RIGHT)
END IF
DIALOG SHOW MODAL hDlg CALL DlgProc
END FUNCTION
...
The first post of this thread has been updated with version 4.73
The "Buttons.exe" project has been reworked to include more buttons, and the new Clock Widget.
Here is how to use the new features:
FUNCTION PBMAIN () AS LONG
LOCAL hDlg AS DWORD, hCtrl AS LONG, sResource AS STRING
DIALOG NEW PIXELS, 0, "Buttons",,, 480, 360, %WS_OVERLAPPEDWINDOW, 0 TO hDlg
IF skInitEngine("Sony.sks", "") THEN
CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")
sResource = EXE.Path$ + "Resource\"
hCtrl = skButtonImage(hDlg, sResource + "BTN_Left.png", 216-57, 300+12, %IDC_BTN_LEFT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "BTN_Play.png", 216, 300, %IDC_BTN_PLAY, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "BTN_Right.png", 216+49, 300+12, %IDC_BTN_RIGHT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ_BOTTOM)
hCtrl = skPushButtonImage(hDlg, sResource + "Check_32.png", "%BS_LEFT", 20, 20, 140, 50, %IDC_BTN_CHECK, %BS_LEFT)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Delete_32.png", "%BS_CENTER", 20 + 140 + 8, 20, 140, 50, %IDC_BTN_CHECK, %BS_CENTER)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Recycle_32.png", "%BS_RIGHT", 20 + (140 + 8) * 2, 20, 140, 50, %IDC_BTN_CHECK, %BS_RIGHT)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER_HORZ)
hCtrl = skPushButtonImage(hDlg, sResource + "Print_32.png", "%BS_TOP", 20, 20 + 70, 140, 50, %IDC_BTN_PRINT, %BS_TOP)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, "", "WITHOUT IMAGE", 20 + 140 + 8, 20 + 70, 140, 50, %IDC_BTN_TEXT, %BS_CENTER)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "Save_32.png", "%BS_BOTTOM", 20 + (140 + 8) * 2, 20 + 70, 140, 50, %IDC_BTN_SAVE, %BS_BOTTOM)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "00_32.png", "", 40 + (40 * 0), 20 + 140, 38, 38, %IDC_BTN_00, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "01_32.png", "", 40 + (40 * 1), 20 + 140, 38, 38, %IDC_BTN_01, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "02_32.png", "", 40 + (40 * 2), 20 + 140, 38, 38, %IDC_BTN_02, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "03_32.png", "", 40 + (40 * 3), 20 + 140, 38, 38, %IDC_BTN_03, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "04_32.png", "", 40 + (40 * 4), 20 + 140, 38, 38, %IDC_BTN_04, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "05_32.png", "", 40 + (40 * 5), 20 + 140, 38, 38, %IDC_BTN_05, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "06_32.png", "", 40 + (40 * 6), 20 + 140, 38, 38, %IDC_BTN_06, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "07_32.png", "", 40 + (40 * 7), 20 + 140, 38, 38, %IDC_BTN_07, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "08_32.png", "", 40 + (40 * 8), 20 + 140, 38, 38, %IDC_BTN_08, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
hCtrl = skPushButtonImage(hDlg, sResource + "09_32.png", "", 40 + (40 * 9), 20 + 140, 38, 38, %IDC_BTN_09, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_CENTER)
' // 4.73 WinLIFT clock
' hCtrl = skClockCtrl(hDlg, sResource + "Clock_06_92.png", 14, 258, 0, 0, %IDC_CLOCK, &HFFCBCBCB, &H7F9F9F9F, 0)
' hCtrl = skClockCtrl(hDlg, sResource + "Clock_02_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
' hCtrl = skClockCtrl(hDlg, sResource + "Clock_03_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
hCtrl = skClockCtrl(hDlg, sResource + "Clock_01_92.png", 14, 258, 0, 0, %IDC_CLOCK, &H7FCB0000, &H7F8F8F8F, 0)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)
' hCtrl = skButtonImage(hDlg, sResource + "32bit_80.png", 20, 264, %IDC_BTN_32BIT, 5)
' CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM)
hCtrl = skButtonImage(hDlg, sResource + "64bit_80.png", 380, 264, %IDC_BTN_64BIT, 5)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_BOTTOM_RIGHT)
END IF
DIALOG SHOW MODAL hDlg CALL DlgProc
END FUNCTION
And the result is
(http://www.zapsolution.com/pictures/Buttons.jpg)
Note: You can edit the source code to try different Clock Widget background.
...
Attached are two extra clock widget backgrounds (very nice).
...
Attached to this post you will find the Zooming project + WinLIFT version 4.74.
There are two images, using variable opacity, in the "Resource" subfolder to play with.
Better to play the demo hover a dark background, to see the halo and all the transparency effects.
This demo embeds a GDImage zoom graphic control, to use the exclusive composited Crystal mode, rather than AERO blur. But you can still change the background.
This project was done to see how far i could go with WinLIFT and the DWM technology.
(http://www.zapsolution.com/pictures/Aero.jpg)
...
QuoteHi Patrice,
that I have thought of that, all creating, not show it. And then the View tab if it is needed. But would it for love Dynamic. Need it that is for my CD database. For example, if a cover for a CD in the database because it is intended to show a tab with an image control. But I can wait there is no hurry for me. 'm Sure you make it!
Regards Peter
Peter,
WinLIFT version 4.78 is attached to this post.
I have reworked the new API
skSkinWindowUpdate below, to let it work with the example your posted in the "tabcontrolmore.bas" project.
'// 4.77 Use this when new controls are added AFTER the initial skinning of the main window.
DECLARE SUB skSkinWindowUpdate LIB "WinLIFT.dll" ALIAS "skSkinWindowUpdate" ( _
BYVAL hWnd AS LONG, _ ' The main window handle.
BYVAL RedrawFlag AS LONG _ ' Redraw boolean flag.
)
Note: hWnd must be the handle of the main window.
...
The first post of this thread has been updated to version 4.79.
New: The gauge.bas demo has been added to the ZIP file.
Fix: Using %WM_SETTEXT on a hidden control, doesn't show it anymore.
...
I have been asked if WinLIFT could be used to skin a Windows common dialog.
I did try with the common OpenFile dialog, and here is the result:
(http://www.zapsolution.com/pictures/OpenFile.jpg)
It is not 100% perfect, because i can't take control over the scrollbars, and the Folder ListView is not skinned because its is an encapsulation of the SHELLDLL_DefView.
To do this, you need to hook the common dialog, using the lpfnHook member of the OPENFILENAME structure.
Then you must handle %CDN_INITDONE in the %WM_NOTIFY callback to retrieve the handle of the common dialog and skin it on the fly. If everything went fine, you should got the same result than in the above screen shot.
If interrested i could post a new version of the Gauge project, showing the skinning of the GDImage custom OpenFile, the one that has been captured to create the screen shot.
...
The first post of this thread has been updated with WinLIFT version 4.82
Many changes (mostly not visible) have been made to this version, especialy to make WinLIFT and GDImage full compatible.
The Gauge project has been reworked to use a fixed watermark logo overlay in the GDImage control.
And the GDImage OpenFileDialog is now skinned on the fly, to show you that it is possible to apply the WinLIFT theme to a common dialog.
You are encouraged to update to this version, and play again with the Gauge project.
Here is the generic code to skin a common OpenFileDialog:
' Dialog hook procedure, for centering the dialog and apply skin on the fly.
FUNCTION zDlgHookProc(BYVAL hWnd AS LONG, BYVAL Msg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
LOCAL rw AS RECT, rc AS RECT, ofnPtr AS OFNOTIFY PTR, zTxt AS ASCIIZ * %MAX_PATH
LOCAL lp AS POINTAPI
LOCAL hDLL, hPROC, nCenterDlg, hFound, hParent, hSysListView AS DWORD
STATIC hWndPreview, SquareSize AS LONG
SELECT CASE LONG Msg
CASE %WM_NOTIFY
ofnPtr = lParam
SELECT CASE LONG @ofnPtr.hdr.Code
CASE %CDN_INITDONE
hParent = GetParent(hWnd)
CALL ShowWindow(hParent, %SW_HIDE)
hSysListView = GetDlgItem(hParent, %lst1)
CALL GetWindowRect(hSysListView, rw)
lp.X = rw.nLeft: lp.Y = rw.nTop: CALL ScreenToClient(hParent, lp) ' 11-03-2003
yPos& = lp.Y
SquareSize = rw.nBottom - rw.nTop
IF GetSystemMetrics(%SM_CXSCREEN) < 801 THEN
SquareSize = MIN&(150, SquareSize)
END IF
CALL GetClientRect(hParent, rc) ' Get dialog pos. and size
xPos& = rc.nRight ' New width
Style& = %WS_CHILD OR %WS_VISIBLE ' OR %WS_BORDER
StyleEx& = %WS_EX_STATICEDGE
hWndPreview = CreateWindowEx(StyleEx&, $GDImageClassName, _
"", _ ' Optional full path name to picture
Style&, _
xPos&, yPos&, SquareSize, SquareSize, _
hParent, _
%NULL, _
zInstance,_
BYVAL 0) ' creation parameters
CALL ZI_SetProperty(hWndPreview, %ZI_GradientTop, GetSysColor(%COLOR_BTNSHADOW))
CALL ZI_SetProperty(hWndPreview, %ZI_GradientBottom, GetSysColor(%COLOR_BTNSHADOW))
CALL ZI_SetProperty(hWndPreview, %ZI_FitToWindow, %ZI_QualityDefault)
' Set new size and center dialog in program window
CALL GetWindowRect(GetParent(hParent), rc) ' Get program pos. and size
W& = rc.nRight - rc.nLeft
H& = rc.nBottom - rc.nTop
x& = rc.nLeft + (W& \ 2) ' Relative Center x&
y& = rc.nTop + (H& \ 2) ' Relative Center y&
CALL GetWindowRect(hParent, rc) ' Get dialog pos. and size
W& = rc.nRight - rc.nLeft + SquareSize + 7 ' New width
H& = rc.nBottom - rc.nTop ' Same height
x& = x& - (W& \ 2) ' Centered in program
y& = y& - (H& \ 2)
CALL SetWindowPos(hParent, hParent, x&, y&, W&, H&, %SWP_NOZORDER) ' Resize and center
' // Skin the dialog on the fly.
CALL skSkinWindow(hParent, "Dock|Undock|Minimize|Maximize|Restore|Close")
CALL ShowWindow(hParent, %SW_SHOW)
FUNCTION = 1: EXIT FUNCTION
CASE %CDN_SELCHANGE ' Triggered when the selection changes in the file listbox
picFileName$ = SPACE$(%MAX_PATH)
df& = Sendmessage(@ofnPtr.hdr.hwndFrom, %CDM_GETFILEPATH, LEN(picFileName$), STRPTR(picFileName$))
IF df& > 0 THEN
picFileName$ = LEFT$(picFileName$, df& - 1)
So& = INSTR(-1, picFileName$, $Dot)
IF So& THEN
ImgType$ = UCASE$(MID$(picFileName$, So&)) + $Dot
ImageType& = INSTR($GDIPLUSEXT, ImgType$)
IF ImageType& THEN
NewImage& = zLoadImageFromFile((picFileName$), bmW&, bmH&, 0)
IF zSetGdipImageHandle(hWndPreview, NewImage&) THEN CALL ZI_UpdateWindow(hWndPreview, %TRUE)
END IF
END IF
'
END IF
picFileName$ = ""
CASE %CDN_TYPECHANGE
' Standard Save dialog blindly adds new extension, this changes it properly instead
IF @ofnPtr.@lpOFN.nFilterIndex < 5 THEN ' ignore last one, *.*
hftCombo& = GetDlgItem(GetParent(hWnd), %cmb1) ' handle, File type combo
IF zOsVersion < 500 THEN ID& = %edt1 ELSE ID& = %cmb13
hftEdit& = GetDlgItem(GetParent(hWnd), ID&) ' handle, File name text field
CALL GetWindowText(hftEdit&, zTxt, SIZEOF(zTxt)) ' get name in text field
IF LEN(zTxt) THEN ' if we have something
lRes& = INSTR(-1, zTxt, $Dot) ' look for prefix (file type part)
IF lRes& THEN zTxt = LEFT$(zTxt, lRes& - 1) ' if success, remove prefix
SELECT CASE LONG @ofnPtr.@lpOFN.nFilterIndex ' compare selection against combo list
CASE 1: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 1)) ' ".png" ' and add matching prefix
CASE 2: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 2)) ' ".jpg"
CASE 3: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 3)) ' ".bmp"
CASE 4: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 4)) ' ".tif"
CASE 5: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 5)) ' ".gif"
CASE 6: zTxt = zTxt + $Dot + LCASE$(PARSE$(cfgStr$(40), 6)) ' ".zmi"
END SELECT
CALL SetWindowText(hftEdit&, zTxt) ' set corrected name to text field
END IF
END IF
END SELECT
CASE %WM_DESTROY ' Destroy what we have created to avoid nasty memory leaks
END SELECT
END FUNCTION
FUNCTION zOpenFileDialog (BYVAL hWnd AS DWORD, _ ' parent window
BYVAL sCaption AS STRING, _ ' caption
BYREF sFilespec AS STRING, _ ' filename
BYVAL sInitialDir AS STRING, _ ' start directory
BYVAL sFilter AS STRING, _ ' filename filter
BYVAL sDefExtension AS STRING, _ ' default extension
BYREF dFlags AS DWORD ) AS LONG ' flags
LOCAL ix AS LONG, Ofn AS OPENFILENAME
LOCAL zFileTitle AS ASCIIZ * %MAX_PATH
REPLACE $zLim WITH $NUL IN sFilter
IF LEN(sInitialDir) = 0 THEN sInitialDir = CURDIR$
ix = INSTR(sFileSpec, $NUL)
IF ix THEN
sFileSpec = LEFT$(sFileSpec, ix) + SPACE$(8192 - ix)
ELSE
sFileSpec = sFileSpec + $NUL + SPACE$(8192 - (LEN(sFileSpec) + 1))
END IF
ofn.lStructSize = SIZEOF(ofn)
ofn.hWndOwner = hWnd
ofn.lpstrFilter = STRPTR(sFilter)
ofn.lpstrFile = STRPTR(sFilespec)
ofn.nMaxFile = LEN(sFilespec)
ofn.lpstrFileTitle = VARPTR(zFileTitle)
ofn.nMaxFileTitle = SIZEOF(zFileTitle)
ofn.lpstrInitialDir = STRPTR(sInitialDir)
IF LEN(sCaption) THEN
ofn.lpstrTitle = STRPTR(sCaption)
END IF
ofn.Flags = dFlags
ofn.lpfnHook = CODEPTR(zDlgHookProc)
ofn.lpstrDefExt = STRPTR(sDefExtension)
'Note: following Select Case table must be adjusted to match used Filter string
' (also remember to do the same in zDlgHookProc procedure..)
UperExt$ = UCASE$(sDefExtension)
IF UperExt$ = PARSE$(cfgStr$(40), 1) THEN
ofn.nFilterIndex = 1 ' PNG nFilterIndex decides Filytype combo's listitem
ELSEIF UperExt$ = PARSE$(cfgStr$(40), 2) THEN
ofn.nFilterIndex = 2 ' JPG
ELSEIF UperExt$ = PARSE$(cfgStr$(40), 3) THEN
ofn.nFilterIndex = 3 ' BMP
ELSEIF UperExt$ = PARSE$(cfgStr$(40), 4) THEN
ofn.nFilterIndex = 4 ' TIF
ELSE
ofn.nFilterIndex = 8 ' *.*
END IF
FUNCTION = GetOpenFilename(ofn)
dFlags = ofn.Flags
END FUNCTION
...
I have posted a new "Panorama 360" project on the FireFly forum.
See attached screen shot.
...
The first post of this thread has been updated to WinLIFT version 4.85
New API:
DECLARE FUNCTION skStaticImage LIB "WinLIFT.dll" ALIAS "skStaticImage" ( _
BYVAL hOwner AS LONG, _ ' Handle of the window parent owner.
zFullpathImageName AS ASCIIZ, _ ' Full path name to the static image.
BYVAL x AS LONG, _ ' X location of the static image control.
BYVAL y AS LONG, _ ' Y location of the static image control.
BYVAL W AS LONG, _ ' Width of the static image control.
BYVAL H AS LONG, _ ' Height of the static image control.
BYVAL nID AS LONG _ ' Unique ID of the static image control.
) AS LONG
DECLARE SUB skSetZorder LIB "WinLIFT.dll" ALIAS "skSetZorder" ( _
BYVAL hCtrl AS LONG, _ ' Handle of the child control.
BYVAL UseOrder AS LONG _ ' %HWND_ constant or another child control handle.
)
The "Buttons.bas" project has been updated, to show you how to use them, see below:
' // Version 4.85
hCtrl = skStaticImage(hDlg, sResource + "Aero.png", 10, 10, 460, 208, %IDC_FRAME)
CALL skSetZorder(hCtrl, %HWND_BOTTOM)
CALL skSetAnchorCtrl(hCtrl, %ANCHOR_HEIGHT_WIDTH)
' // Version 4.85
hCtrl = skStaticImage(hDlg, sResource + "makeuplips.png", -20, -70, 200, 134, %IDC_LIPS)
CALL skSetZorder(hCtrl, %HWND_TOP)
...
The new WinLIFT CHM help zip file has been attached to the first post of this thread
(http://www.zapsolution.com/pictures/winliftchm.jpg)
...
Hi Patrice,
Thanks for the help file! Good idea! ;D
Regards Peter
Peter,
I was rather lazy on this, i should have written it for long. ;)
...
Hi Patrice,
I am currently a bit lazy! object on my pbfreedb I have not worked for almost a whole year. The console tools I have at the moment even a hangover. I sometimes do not know whether it makes sense to carry on! Sometimes I think to myself whether it even makes sense to program. There are already almost everything. Then I think to myself who actually programmed the still. We are all so old PowerBASIC programmers around 50 years. I think sometimes we are among a dying species. And are made a protected species!
Regards Peter ;D
The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".
...