Recent Posts

Pages: 1 [2] 3 4 ... 10
11
The concept / WinLIFT 64-bit 7.00, new API
« Last post by Patrice Terrier on January 09, 2024, 01:17:49 pm »
IMPORTANT!
When using multiple skinned windows in a single project,
the main window must always be skinned first.

New constants used in Version 7.00

To be used with the new skAnchorID API

const int AT_TOP         = 1;
const int AT_LEFT        = 2;
const int AT_RIGHT       = 4;
const int AT_BOTTOM      = 8;
const int AT_TOPLEFT     = 3;
const int AT_TOPRIGHT    = 5;
const int AT_BOTTOMLEFT  = 10;
const int AT_BOTTOMRIGHT = 12;
const int AT_ALL         = 15;

const int DOCK_TOP       = 256;
const int DOCK_LEFT      = 512;
const int DOCK_RIGHT     = 1024;
const int DOCK_BOTTOM    = 2048;
const int DOCK_FILL      = 3840;


New Version 7.00 APIs

BOOL skAnchorID(HWND hWnd, UINT uID, UINT uFlag)
To anchor a specific control uID within its hWnd parent container,
using any or a combination of the above constant uFlag.

BOOL skAnchorInit(HWND hWnd)
Init/Reset Anchor properties

BOOL skAnchorResize(HWND hWnd, BOOL bRepaint)
Resize the child controls, if ever you need to resize the main hWnd window yourself.

BOOL skAnchorRemoveAll(HWND hWnd)
Remove (delete) all anchor properties for the specific hWnd handle.

long skUseAnchorMode(HWND hWnd, IN long UseMode)
Use one of the exclusive constant below.

const int CANCELMODE     = -1;
const int ANCHORMODE     = 32;
const int HOMOTHETIC     = 64;


When using ANCHORMODE, it must be used after you setup all the individual skAnchorID properties.

HOMOTHETIC is exclusive, and couldn't be inter-mixed with other properties.
All childs controls belonging to hWnd are resized using an homothetic float ratio.
The original float ratio = 1.0f, that is the size of the window when calling skSkinWindow.
(This size is also used to compute the minimum WM_GETMINMAXINFO track size).

void skSetListViewImage(WCHAR* FullPathName, long ReadWriteFlag)
A ListViewImage is a single .png bitmap composed of different icons, each one must fit within a square size being the same for all images.
To be used in conjunction with a #{TAG} message, where TAG could be any letter in the range A-Z. The TAG must be inserted directly into the string used for a specific cell.
Example of image list:


void skSetToolBarImage(WCHAR* FullPathName, long ReadWriteFlag)
Same as above but for a ToolBar control.
The TAG must be inserted directly into each tool text name.

void skGetWindowSize(IN HWND hWnd, OUT long &x, OUT long &y, OUT long &WindowWidth, OUT long &WindowHeight)
The returned parameters are converted from WinLIFT SystemMetrics into standard window coordinates, in case you want to restore the window size and location in a next session.

BOOL skSkinChange(IN WCHAR* zSkinFile)
Change the skin theme on the fly, using a full qualified path to a WinLIFT .sks file.

WinLIFT.chm
The previous WinLIFT.chm file from version 4.87 is attached to this post, the existing API have been preserved, except that all strings in Version 7.00 require the use of UNICODE (WCHAR, WSTRINGZ).
12
The concept / WinLIFT 64-bit 7.00 (is attached to this post)
« Last post by Patrice Terrier on December 17, 2023, 06:21:32 pm »
WinLIFT 7.00 in action skinning a PureBasic application.

This version is able to change the skin theme on the fly,
it supports ImageList when available, and/or specific TAG to display images in a ListView.




WinLIFT 7.00 is available in either 32 or 64-bit,
as a (paypal) donate-ware Win32 DLL addon.


Note: WinLIFT 7.00 uses only UNICODE (WCHAR/WSTRINGZ) strings

The 64-bit version is attached to this post with:

Busi (folder with corresponding images theme components)
Busi.sks (Skin file parameters)
WinLIFT.h (C++ header file include)
WinLIFT64.lib (link file)
WinLIFT64.dll (the 64-bit DLL)
...
13
Questions & Comments about WinLIFT / HOMOTHETIC resize
« Last post by Patrice Terrier on November 23, 2023, 10:28:55 am »
This is a new version of the Resize project.

I kept the previous post for tutorial purposes, because the HOMOTHETIC computation is now part of the WinLIFT64.dll code.

In this new version, there is no need first to use the new skAnchorID API,
because the same homothetic ratio is applied to all child controls.

Just use skUseAnchorMode(hwnd, HOMOTHETIC).
14
Questions & Comments about WinLIFT / Re: WinLIFT Experimental version
« Last post by Patrice Terrier on November 19, 2023, 10:44:41 am »
Here is another C++ example (debug version) showing the use of anchor properties.

Updated version of the Resize mockup is attached to this post.

What is new:

Anchor properies using power of 2 for greater flexibility

const int AT_TOP         = 1;
const int AT_LEFT        = 2;
const int AT_RIGHT       = 4;
const int AT_BOTTOM      = 8;
const int AT_TOPLEFT     = 3;
const int AT_TOPRIGHT    = 5;
const int AT_BOTTOMLEFT  = 10;
const int AT_BOTTOMRIGHT = 12;
const int AT_ALL         = 15;

const int DOCK_TOP       = 256;
const int DOCK_LEFT      = 512;
const int DOCK_RIGHT     = 1024;
const int DOCK_BOTTOM    = 2048;
const int DOCK_FILL      = 3840;


AnchorOnSize(FALSE);


Homothetic resizing

Rather than being anchored, all controls are using an homogeneous dilatation, using the initial size of the popup window as the reference ratio value of 1.0f.

HomotheticOnSize(FALSE);

Sof far, you can use either Anchor or Homothetic, but not mix them together.

15
Questions & Comments about WinLIFT / WinLIFT anchor properties
« Last post by Patrice Terrier on November 17, 2023, 06:40:02 pm »
Here is the first WinLIFT tutor using the Experimental* Version 6.00

The code has been highly optimized to produce a tiny 124 Kb 64-bit DLL

The "Buttons" project is using only WinLIFT controls, to illustrate the concept of anchor/dock properties, that is the modern paradigm to resize child controls.

Search in the code for: skSetAnchorCtrl

The project is provided with its full VS2022 C++ source code, configured in release mode to produce a... 15 Kb binary EXE.

Being able to produce such small binary files is only possible when using the Windows FLAT API in procedural mode, and by nowadays standard it is becoming a lost art.

Note: Experimental, means work in progress...
16
Questions & Comments about WinLIFT / Re: WinLIFT Experimental version
« Last post by Patrice Terrier on November 05, 2023, 09:34:12 am »
I am progressing slowly with verssion 6.00.

What about:
1 - Support for multiple popup application running in the same thread.
2 - ListView column drag & drop.
3 - ListView can use Private font (skSetLabelFont).
4 - PureBasic custom class detection.
5 - Code cleanup, optimization, and size reduction.
...
17
Questions & Comments about WinLIFT / WinLIFT Experimental version
« Last post by Patrice Terrier on September 24, 2023, 11:06:00 pm »
The experimental version is a work in progress.
Old .sks files from version 4 should not be used with it,
some parameters are missing (causing random memory errors).

The correct .sks files to use must be those from version 5.00, with tooltip colors definition.
18
The concept / Tutor_18 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on September 05, 2023, 09:26:17 am »
Eighteenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_18
This is a C++ transcription of a PowerBASIC demo written in 2009 with the official release of GDImage 5.00.
It was the first version able to mix 2D and 3D OpenGL into the same graphic control.
The application itself is skinned with WinLIFT, and share the same background wallpaper with all child controls.

The animation
Is using 1 OpenGL sphere (to display the moon, jupiter, mars, and pluto).
A multiframe bitmap to render the Jumper.
A text label bitmap.
And a mute button.

WinLIFT 6.00
Is an experimental version converted to VS2022, the whole code has been revisited for further code size reduction.
New API skMinTrackSizeX ();
return the minimum width size of main window once skinned.
New API skMinTrackSizeY ();
return the minimum height size of main window once skinned.
New API skUseThisBackground(IN HWND hWnd, IN WCHAR* zItem);
To change on the fly the wallpaper background without using the top left icon,
even when the .sks parameter is disabled "BACKGROUNDPATH,      resource\Background"
The skInitEngine API has an extra optional parameter:
skInitEngine (IN WCHAR* zSkinFile, IN WCHAR* zUserKey, IN HWND hParent);

GDImage 7.16
Is an experimental version converted to VS2022, with a new API named "ZD_GLtoBitmap" to dynamically turn the OpenGL context into a ZOBJECT sprite bitmap (see the RenderAnimation() procedure).


Last but not least,
the size of the standalone binary EXE is only 17 Kb.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
19
The concept / Re: Tutor-17 (C++ VS2022 GDImage64.dll tutorial)
« Last post by Patrice Terrier on September 04, 2023, 02:45:03 pm »
You can manage the clone(s) using their own object ID in the callback.

long CALLBACK GDImageCallBack(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {
    long nRet = 0; // Do not stop the event processing in GDImage

    static BOOL LeftMouseClick;

    long nID = ZI_MouseOverObjectID(); // <--- You can get the clone ID here

    switch (uMsg) {

    case WM_RBUTTONDOWN:
        if (nID == IDS_3DOBJECT) LeftMouseClick = TRUE;
        break;

    case WM_RBUTTONUP:
        if (nID == IDS_3DOBJECT && LeftMouseClick == TRUE) {
            gP.MouseHit = -1; LeftMouseClick = FALSE;
        }
        break;
    }

    return nRet;
}


However in this specific case, the clone(s) do not duplicate the OpenGL object, they clone only the bitmap of the IDS_3DOBJECT.
20
The concept / Re: Tutor-17 (C++ VS2022 GDImage64.dll tutorial)
« Last post by Shao Voon Wong on September 04, 2023, 12:01:22 pm »
Thanks Patrice!

Regarding the cloned cubes, what other information is cloned when we clone an object? Why the event callback in GDImageEnableEvents() is not cloned?
Pages: 1 [2] 3 4 ... 10