Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
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)
...
22
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).
23
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.

24
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...
25
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.
...
26
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.
27
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.
28
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.
29
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?
30
The concept / Header for the VS2022 experimental version 6.00
« Last post by Patrice Terrier on September 03, 2023, 10:58:22 am »
Here is the header to use with Version 7.00

Code: [Select]
#include <windows.h>

#define C_IMPORT extern "C" __declspec(dllimport)

const int ANCHOR_NONE                = -1;
const int ANCHOR_LEFT                = 0;//ANCHOR_NONE;
const int ANCHOR_WIDTH               = 1;
const int ANCHOR_RIGHT               = 2;
const int ANCHOR_CENTER_HORZ         = 3;
const int ANCHOR_HEIGHT              = 4;
const int ANCHOR_HEIGHT_WIDTH        = 5;
const int ANCHOR_HEIGHT_RIGHT        = 6;
const int ANCHOR_BOTTOM              = 7;
const int ANCHOR_BOTTOM_WIDTH        = 8;
const int ANCHOR_BOTTOM_RIGHT        = 9;
const int ANCHOR_CENTER_HORZ_BOTTOM  = 10;
const int ANCHOR_CENTER_VERT         = 11;
const int ANCHOR_CENTER_VERT_RIGHT   = 12;
const int ANCHOR_CENTER              = 13;
const int ANCHOR_LAST                = ANCHOR_CENTER;

const int SK_METRICFIRST      = 0;
const int SK_CYCAPTION        = SK_METRICFIRST;
const int SK_CYMENU           = 1;
const int SK_CYSTATUS         = 2;
const int SK_CXFRAMELEFT      = 3;
const int SK_CXFRAMERIGHT     = 4;
const int SK_CYFRAMETOP       = SK_CYCAPTION;
const int SK_CYFRAMEBOTTOM    = 5;
const int SK_CXSIZE           = 6;
const int SK_CYSIZE           = 7;
const int SK_CXSYSBUT         = 8;
const int SK_CYSYSBUT         = 9;
const int SK_CXCAPTEXT        = 10;
const int SK_CYCAPTEXT        = 11;
const int SK_XBUT3DBORDER     = 12;
const int SK_YBUT3DBORDER     = 13;
const int SK_CXSYSICON        = 14;
const int SK_CYSYSICON        = 15;
const int SK_CXSYSLED         = 16;
const int SK_CYSYSLED         = 17;
const int SK_TRANSLUCENCY     = 18;
const int SK_MENUTRANSLUCENCY = 19;
const int SK_PAINT_BORDER     = 20;
const int SK_PAINT_BACKGROUND = 21;
const int SK_ICONSIZE         = 22;
const int SK_OUTER_GLOW       = 23;
const int SK_SKIN_ICON        = 24;
const int SK_DWM_AERO         = 25;
const int SK_DWM_LEFT         = 26;
const int SK_DWM_TOP          = 27;
const int SK_DWM_RIGHT        = 28;
const int SK_DWM_BOTTOM       = 29;
const int SKMETRIC_UB         = 30;

C_IMPORT HWND     skPopupOwner (IN HWND hWnd);
C_IMPORT HFONT    skCaptionFont ();
C_IMPORT HFONT    skFont ();
C_IMPORT HFONT    skFontBold ();
C_IMPORT HFONT    skFontDlg ();
C_IMPORT LONG_PTR skCaptionFontPlus ();
C_IMPORT LONG_PTR skFontPlus ();
C_IMPORT LONG_PTR skFontBoldPlus ();
C_IMPORT LONG_PTR skFontDlgPlus ();
C_IMPORT void     skSkinDisable (IN HWND hWnd);
C_IMPORT void     skSetZorder (IN HWND hWnd, IN HWND UseOrder);
C_IMPORT HDC      skGetHdcMemBmp (IN HWND hOwner);
C_IMPORT DWORD    skARGB (IN BYTE A, IN BYTE R, IN BYTE G, IN BYTE B);
C_IMPORT void     ComputeAspect (IN long xPic, IN long yPic, IN long xCell, IN long yCell, OUT long &xP, OUT long &yP, OUT long &xS, OUT long &yS);
C_IMPORT void     skChildOffset (IN HWND hWnd, OUT long &ofX, OUT long &ofY);
C_IMPORT void     skSetLabelFont (IN HWND hCtrl, IN WCHAR* zFontName, IN WORD nFontSize, IN long ARGBcolor, IN WORD nFontStyle, IN BOOL redraw);
C_IMPORT WCHAR*   skVersion ();
C_IMPORT long     skSetAnchorCtrl (IN HWND hWnd, IN long AnchorMode);
C_IMPORT long     skUsingDWM ();
C_IMPORT WCHAR*   skSkinFolder ();
C_IMPORT HWND     skButImage (IN HWND hOwner, OUT HBITMAP hBitmap, IN long xLeft, IN long yLeft, IN long ButID);
C_IMPORT WCHAR*   skAuthor ();
C_IMPORT HWND     skBorder (IN HWND hWnd, IN long x, IN long y, IN long xW, IN long yH, IN long nID, IN long nBorder);
C_IMPORT void     skSkinChildCtrl (IN HWND hWnd, IN long RedrawFlag);
C_IMPORT void     skSkinEnable (IN HWND hWnd);
C_IMPORT void     skRedrawMenuBar(IN HWND hWnd);
C_IMPORT HMENU    skGetMenu (IN HWND hWnd);
C_IMPORT HWND     skMenuContainer (IN HWND hWnd);
C_IMPORT void     skSkinWindowUpdate (IN HWND hWnd, IN long RedrawFlag);
C_IMPORT long     skSkinWindow (IN HWND hWnd, WCHAR* zSysButTip);
C_IMPORT HWND     skCreateDW (IN HWND hParent);
C_IMPORT void     skDestroyDW (OUT HWND &hDW);
C_IMPORT long     skDialogAlert (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogError (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogInfo (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT long     skDialogYesNo (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT WCHAR*   skDialogInput (IN WCHAR* zCaption, IN WCHAR* zMessage, IN WCHAR* zButton);
C_IMPORT HWND     skButtonImage (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long ButID, IN long StateMax);
C_IMPORT HWND     skPushButtonImage (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN WCHAR* zLabel, IN long x, IN long y, IN long xW, IN long yH, IN long ButID, IN long Alignment);
C_IMPORT void     skSetToolTipText (IN HWND hObj, IN WCHAR* zText);
C_IMPORT WCHAR*   skGetToolTipText (IN HWND hObj);
C_IMPORT HWND     skCreateToolTip (IN HWND hObj, IN WCHAR* zText);
C_IMPORT void     skRemoveToolTip (IN HWND hObj);
C_IMPORT HWND     skClockCtrl (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long nID, IN long ARGB1, IN long ARGB2, IN long GMT);
C_IMPORT long     skComputeAngleFromPoint(IN HWND hWnd, IN long mX, IN long mY);
C_IMPORT void     skGaugeSetMinMax (IN HWND hCtrl, IN long nMin, IN long nMax);
C_IMPORT void     skGaugeGetMinMax (IN HWND hCtrl, OUT long &nMin, OUT long &nMax);
C_IMPORT void     skGaugeSetPos (IN HWND hCtrl, IN long nPos, IN long RedrawFlag);
C_IMPORT long     skGaugeGetPos (IN HWND hCtrl);
C_IMPORT HWND     skKnobGauge (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long ButID, IN long MinValue, IN long MaxValue, IN long UsePos, IN long StateMax);
C_IMPORT HWND     skStaticImage (IN HWND hOwner, WCHAR* zFullpathImageName, IN long x, IN long y, IN long w, IN long h, IN long nID);
//C_IMPORT HWND     skGetDWMregion (IN HWND hWnd);
C_IMPORT long     skGetSystemMetrics (IN long nMeasure);
C_IMPORT HBITMAP  skSkiToDib (IN WCHAR* szFile, OUT long &nReserved);
C_IMPORT long     skTerminateProcess (IN WCHAR* szModule);
C_IMPORT void     skPaintBrushBitmap (IN HDC hDC, IN long x, IN long y, IN long nWidth, IN long nHeight, IN DWORD ARGBcolor);
C_IMPORT HWND     skTrackbar (IN HWND hOwner, IN WCHAR* zFullpathImageName, IN long x, IN long y, IN long tW, IN long tH, IN long ButID, IN long tMin, IN long tMax, IN long tVal, IN long ARGBcolor);
C_IMPORT long     skGetTrackValue(IN HWND hWnd);
C_IMPORT void     skSetTrackValue(IN HWND hWnd, IN long tVal);
C_IMPORT void     skSetLabelColor (IN HWND hCtrl, IN long ARGBcolor);
C_IMPORT long     skDoNotSkinPopupMenu (IN long nOnOff, IN long RW);

C_IMPORT void     skMaximize(IN HWND hWnd); // 06-25-2015
C_IMPORT void     skRestore(IN HWND hWnd);  // 06-25-2015
C_IMPORT void     skRestoreCaption(IN HWND hWnd, IN BOOL nBool);  // 01-01-2017

C_IMPORT void     skSetTrackRange(IN HWND hWnd, IN long tMin, IN long tMax); // 09-09-2017
C_IMPORT void     skGetTrackRange(IN HWND hWnd, OUT long &tMin, OUT long &tMax); // 09-09-2017
C_IMPORT long     skGetSysColor(IN long nC); // 09-09-2017
C_IMPORT HWND     skLabel(IN HWND hOwner, IN WCHAR* zFullpathBackground, IN WCHAR* zLabel, IN long x, IN long y, IN long xW, IN long yH, IN long ButID, IN long Alignment); // 09-12-2017
C_IMPORT LONG_PTR skGetLabelFont(IN HWND hCtrl); // 2017-09-13

C_IMPORT HBITMAP  SkGetSbVertBitmap();
C_IMPORT HBITMAP  SkGetSbHorzBitmap();
C_IMPORT HBITMAP  SkGetSbPictoBitmap();
C_IMPORT void     skPaintButton(IN HDC hDC, IN long nB, IN HBITMAP hBmp, IN long nX, IN long nY, IN long xWidth, IN long yHeight);
C_IMPORT void     DrawPicto(IN HDC hDC, IN long nB, IN long nX, IN long nY, IN long xWidth, IN long yHeight);
C_IMPORT void     skSetSystemMetrics(IN long nMeasure, IN long UseValue);

C_IMPORT void     skRedrawNcArea(IN HWND hWnd);

// 08-31-2023 Version 6.00
C_IMPORT long     skMinTrackSizeX(HWND hWnd);
C_IMPORT long     skMinTrackSizeY(HWND hWnd);
C_IMPORT long     skInitEngine (IN WCHAR* zSkinFile, IN WCHAR* zUserKey);
C_IMPORT long     skUseThisBackground(IN HWND hWnd, IN WCHAR* zItem);
C_IMPORT void     skGetClientSize(IN HWND hWnd, OUT long &xClient, OUT long &yClient, OUT long &ClientWidth, OUT long &ClientHeight);

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;

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

C_IMPORT BOOL     skAnchorInit(HWND hWnd);
//C_IMPORT BOOL     skHomotheticResize(HWND hWnd, BOOL bRepaint);
C_IMPORT BOOL     skAnchorResize(HWND hWnd, BOOL bRepaint);
C_IMPORT BOOL     skAnchorID(HWND hWnd, UINT uID, UINT uFlag);
C_IMPORT BOOL     skAnchorRemoveAll(HWND hWnd);
C_IMPORT long     skUseAnchorMode(HWND hWnd, IN long UseMode);
C_IMPORT void     skSetListViewImage(WCHAR* FullPathName, long ReadWriteFlag);
C_IMPORT void     skSetToolBarImage(WCHAR* FullPathName, long ReadWriteFlag);
C_IMPORT void     skGetWindowSize(IN HWND hWnd, OUT long &x, OUT long &y, OUT long &WindowWidth, OUT long &WindowHeight);
C_IMPORT BOOL     skSkinChange(IN WCHAR* zSkinFile);
Pages: 1 2 [3] 4 5 ... 10