• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

GDImage Accordion

Started by Patrice Terrier, May 02, 2014, 06:29:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

The purpose of this small GDImage/WinLIFT project is to demonstrate the use of the GDImage Accordion effect.

Another way to present and select pictures...




This 64-bit project could be easily translated to use with WinDev or PowerBASIC.

This is the main code section that performs the accordion effect :
LRESULT CALLBACK MouseMoveCallBack(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) {

    LRESULT nRet = FALSE; // Do not stop the event processing in GDImage

    long nID = ZI_MouseOverObjectID();

    if ( (nID != gP.currentID) && (nID < gP.fontID) ) {
        long K = 0;
        for (K = nID + 1; K < gP.lastID + 1; ++K ) {
             ZD_SetObjectZorder(K, ZD_ORDER_BOTTOM);
        }
        for (K = 1; K < nID; ++K ) {
             ZD_SetObjectZorder(K, K);
        }

        ZD_SetObjectZorder(nID, ZD_ORDER_TOP);

        // Add a little blup sound effect.
        WCHAR szFile[MAX_PATH]; PathCombine(szFile, EXEresource(), L"blup.wav");
        PlaySound(szFile, NULL, SND_FILENAME | SND_ASYNC);

        ZOBJECT z; ZD_GetObjectProperties(nID, z);
        long xPos = z.x1, nWidth = z.x2, nStep = 256;
        K = nWidth - nStep;
        while (K < nWidth) {
            K = nWidth - nStep;
            z.x2 = K;
            if (nID > gP.currentID) { z.x1 = xPos + nWidth - z.x2; }
            ZD_SetObjectProperties(nID, z);
            ZD_SetObjectAlpha (nID, 255, TRUE);
            nStep /= 2;
        }
        z.x2 = nWidth; z.x1 = xPos; ZD_SetObjectProperties(nID, z);

        // Update the image caption name
        ZD_SetObjectZorder(gP.fontID, ZD_ORDER_TOP);
        ZD_SetObjectXY(gP.fontID, z.x1 + 10, z.y1 + 10, FALSE);
        ZD_SetObjectTextEx(gP.fontID, ZD_GetObjectImageLabel(nID), TRUE);

        gP.currentID = nID;

    }

    return nRet;
}


The attached ZIP file comprise both the VS2010 C++ source code, and the binary EXE (in the X64\Release folder).

...




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

Patrice Terrier

Here is the transposition of the C++ Accordion project to PowerBASIC.

It becomes realy easy to translate from C++ to PB, when using only the plain procedural SDK syntax.
It is even possible to reduce the size of the resulting PB code, using only the native core API rather than the PB encapsulation (see GetModuleFileName and PathCombine).

The source code

'//+--------------------------------------------------------------------------+
'//|                                                                          |
'//|                               Accordion                                  |
'//|                                                                          |
'//|                       GDImage accordion effect                           |
'//|                                                                          |
'//+--------------------------------------------------------------------------+
'//|                                                                          |
'//|                         Author Patrice TERRIER                           |
'//|                            copyright(c) 2014                             |
'//|                           www.zapsolution.com                            |
'//|                        pterrier@zapsolution.com                          |
'//|                                                                          |
'//+--------------------------------------------------------------------------+
'//|                  Project started on : 04-28-2014 (MM-DD-YYYY)            |
'//|                        Last revised : 05-04-2014 (MM-DD-YYYY)            |
'//+--------------------------------------------------------------------------+

#COMPILE EXE "AccordionPB.exe"
#INCLUDE "gdimage.inc"
#INCLUDE "winlift.inc"

%IDC_ARROW            = 32512&
%COLOR_WINDOW         = 5
%NULL                 = 0
%TRUE                 = 1
%FALSE                = 0
%MAX_PATH             = 260
%INVALID_HANDLE_VALUE = &hFFFFFFFF???
%SND_FILENAME         = &h00020000???
%SND_ASYNC            = &h0001
%WS_POPUP             = &h80000000???
%WS_CHILD             = &h40000000???
%WS_VISIBLE           = &h10000000???
%WS_CAPTION           = &h00C00000???
%WS_SYSMENU           = &h00080000???
%WS_MINIMIZEBOX       = &h00020000???
%WS_CLIPSIBLINGS      = &h04000000???
%WS_CLIPCHILDREN      = &h02000000???
%CS_HREDRAW           = &h0002
%CS_VREDRAW           = &h0001
%SM_CXSCREEN          = 0
%SM_CYSCREEN          = 1
%WM_COMMAND           = &H111
%WM_PAINT             = &HF
%WM_DESTROY           = &H2

TYPE RECT
    left AS LONG
    top AS LONG
    right AS LONG
    bottom AS LONG
END TYPE

TYPE PAINTSTRUCT
  hDC AS DWORD
  fErase AS LONG
  rcPaint AS RECT
  fRestore AS LONG
  fIncUpdate AS LONG
  rgbReserved(0 TO 31) AS BYTE
END TYPE

TYPE POINTAPI
    x AS LONG
    y AS LONG
END TYPE

TYPE tagMSG
    hwnd AS DWORD
    message AS DWORD
    wParam AS LONG
    lParam AS LONG
    time AS DWORD
    pt AS POINTAPI
END TYPE

TYPE WNDCLASSEX
    cbSize AS DWORD
    STYLE AS DWORD
    lpfnWndProc AS LONG
    cbClsExtra AS LONG
    cbWndExtra AS LONG
    hInstance AS DWORD
    hIcon AS DWORD
    hCursor AS DWORD
    hbrBackground AS DWORD
    lpszMenuName AS ASCIIZ PTR
    lpszClassName AS ASCIIZ PTR
    hIconSm AS DWORD
END TYPE

TYPE FILETIME
    dwLowDateTime AS DWORD
    dwHighDateTime AS DWORD
END TYPE

TYPE WIN32_FIND_DATA
    dwFileAttributes AS DWORD
    ftCreationTime AS FILETIME
    ftLastAccessTime AS FILETIME
    ftLastWriteTime AS FILETIME
    nFileSizeHigh AS DWORD
    nFileSizeLow AS DWORD
    dwReserved0 AS DWORD
    dwReserved1 AS DWORD
    cFileName AS ASCIIZ * %MAX_PATH
    cAlternateFileName AS ASCIIZ * 14
END TYPE

DECLARE FUNCTION zTrace LIB "zTrace.DLL" ALIAS "zTrace" (zMessage AS ASCIIZ) AS LONG
DECLARE FUNCTION GetModuleFileName LIB "KERNEL32.DLL" ALIAS "GetModuleFileNameA" (BYVAL hModule AS DWORD, BYREF lpFilename AS ASCIIZ, BYVAL nSize AS DWORD) AS DWORD
DECLARE FUNCTION PathCombine LIB "SHLWAPI.DLL" ALIAS "PathCombineA" (BYREF lpszDest AS ASCIIZ, BYREF lpszDir AS ASCIIZ, BYREF lpszFile AS ASCIIZ) AS LONG
DECLARE FUNCTION PlaySound LIB "WINMM.DLL" ALIAS "PlaySoundA" (BYREF pszSound AS ASCIIZ, BYVAL hmod AS DWORD, BYVAL fdwSound AS DWORD) AS LONG
DECLARE FUNCTION FindFirstFile LIB "KERNEL32.DLL" ALIAS "FindFirstFileA" (lpFileName AS ASCIIZ, lpFindFileData AS WIN32_FIND_DATA) AS DWORD
DECLARE FUNCTION FindNextFile LIB "KERNEL32.DLL" ALIAS "FindNextFileA" (BYVAL hFindFile AS DWORD, lpFindFileData AS WIN32_FIND_DATA) AS LONG
DECLARE FUNCTION FindClose LIB "KERNEL32.DLL" ALIAS "FindClose" (BYVAL hFindFile AS DWORD) AS LONG
DECLARE FUNCTION RegisterClassEx LIB "USER32.DLL" ALIAS "RegisterClassExA" (BYREF lpwcx AS WNDCLASSEX) AS WORD
DECLARE FUNCTION CreateWindowEx LIB "USER32.DLL" ALIAS "CreateWindowExA" (BYVAL dwExStyle AS DWORD, BYREF lpClassName AS STRINGZ, BYREF lpWindowName AS STRINGZ, BYVAL dwStyle AS DWORD, BYVAL X AS LONG, BYVAL Y AS LONG, _
                                                                          BYVAL nWidth AS LONG, BYVAL nHeight AS LONG, OPTIONAL BYVAL hwndParent AS DWORD, OPTIONAL BYVAL hMenu AS DWORD, OPTIONAL BYVAL hInstance AS DWORD, _
                                                                          OPTIONAL BYREF lpParam AS ANY) AS DWORD
DECLARE FUNCTION GetMessage LIB "USER32.DLL" ALIAS "GetMessageA" (lpMsg AS tagMSG, BYVAL hWnd AS DWORD, BYVAL uMsgFilterMin AS DWORD, BYVAL uMsgFilterMax AS DWORD) AS LONG
DECLARE FUNCTION TranslateMessage LIB "USER32.DLL" ALIAS "TranslateMessage" (lpMsg AS tagMSG) AS LONG
DECLARE FUNCTION DispatchMessage LIB "USER32.DLL" ALIAS "DispatchMessageA" (lpMsg AS tagMSG) AS LONG
DECLARE FUNCTION AdjustWindowRectEx LIB "USER32.DLL" ALIAS "AdjustWindowRectEx" (lpRect AS RECT, BYVAL dsStyle AS LONG, BYVAL bMenu AS LONG, BYVAL dwEsStyle AS DWORD) AS LONG
DECLARE FUNCTION DefWindowProc LIB "USER32.DLL" ALIAS "DefWindowProcA" (BYVAL hWnd AS DWORD, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LONG) AS LONG
DECLARE FUNCTION GetClassInfoEx LIB "USER32.DLL" ALIAS "GetClassInfoExA" (BYVAL hInst AS DWORD, lpszClass AS ASCIIZ, lpWndClass AS WNDCLASSEX) AS LONG
DECLARE FUNCTION LoadCursor LIB "USER32.DLL" ALIAS "LoadCursorA" (BYVAL hInstance AS DWORD, lpCursorName AS ASCIIZ) AS DWORD
DECLARE FUNCTION SetRect LIB "USER32.DLL" ALIAS "SetRect" (lpRect AS RECT, BYVAL X1 AS LONG, BYVAL Y1 AS LONG, BYVAL X2 AS LONG, BYVAL Y2 AS LONG) AS LONG
DECLARE FUNCTION GetSysColor LIB "USER32.DLL" ALIAS "GetSysColor" (BYVAL nIndex AS LONG) AS LONG
DECLARE FUNCTION GetSystemMetrics LIB "USER32.DLL" ALIAS "GetSystemMetrics" (BYVAL nIndex AS LONG) AS LONG
DECLARE FUNCTION ShowWindow LIB "USER32.DLL" ALIAS "ShowWindow" (BYVAL hWnd AS DWORD, BYVAL nCmdShow AS LONG) AS LONG
DECLARE FUNCTION UpdateWindow LIB "USER32.DLL" ALIAS "UpdateWindow" (BYVAL hWnd AS DWORD) AS LONG
DECLARE SUB PostQuitMessage LIB "USER32.DLL" ALIAS "PostQuitMessage" (BYVAL nExitCode AS LONG)
DECLARE FUNCTION BeginPaint LIB "USER32.DLL" ALIAS "BeginPaint" (BYVAL hWnd AS DWORD, lpPaint AS PAINTSTRUCT) AS LONG
DECLARE FUNCTION EndPaint LIB "USER32.DLL" ALIAS "EndPaint" (BYVAL hWnd AS DWORD, lpPaint AS PAINTSTRUCT) AS LONG

%ClientWidth  = 910
%ClientHeight = 512
%IDC_GDIMAGE  =  -1

type PROP
    gdimage   as DWORD
    currentID as long
    lastID    as long
    FontToUse as ASCIIZ * %MAX_PATH
    fontsize  as long
    fontID    as long
end type

global gP as PROP '// Global accordeon properties

function EXEpath() as string
    static szExepath as asciiz * %MAX_PATH
    if GetModuleFileName(0, szExepath, %MAX_PATH) then
        local K, nLen, nPos as long
        nLen = len(szExepath)
        nPos = nLen
        for K = 1 to nLen
            if ASC(szExepath, nPos - K) <> 92 then
                MID$(szExepath, nPos - K, 1) = CHR$(0)
            else
                exit for
            end if
        next
    end if
    function = szExepath
end function

function EXEresource() as string
    static szResource as asciiz * %MAX_PATH
    PathCombine(szResource, EXEpath(), "Resource\")
    function = szResource
end function

function MouseMoveCallBack(byval hWnd as DWORD, byval uMsg as DWORD, byval wParam as DWORD, byval lParam as long) as long

    local nRet, nID as long
    nRet = %FALSE  '// Do not stop the event processing in GDImage

    nID = ZI_MouseOverObjectID()

    if ( (nID <> gP.currentID) and (nID < gP.fontID) ) then
        local K, xPos, nWidth, nStep as long
        K = 0
        for K = nID + 1 to gP.lastID
             ZD_SetObjectZorder(K, %ZD_ORDER_BOTTOM)
        next
        for K = 1 to nID - 1
             ZD_SetObjectZorder(K, K)
        next

        ZD_SetObjectZorder(nID, %ZD_ORDER_TOP)

        '// Add a little blup sound effect.
        local szFile as ASCIIZ * %MAX_PATH
        PathCombine(szFile, EXEresource(), "blup.wav")
        PlaySound(szFile, %NULL, %SND_FILENAME or %SND_ASYNC)

        local z as ZOBJECT
        ZD_GetObjectProperties(nID, z)
        xPos = z.x1: nWidth = z.x2: nStep = 256
        K = nWidth - nStep
        while (K < nWidth)
            K = nWidth - nStep
            z.x2 = K
            if (nID > gP.currentID) then z.x1 = xPos + nWidth - z.x2
            ZD_SetObjectProperties(nID, z)
            ZD_SetObjectAlpha (nID, 255, %TRUE)
            nStep \= 2
        wend
        z.x2 = nWidth: z.x1 = xPos: ZD_SetObjectProperties(nID, z)

        '// Update the image caption name
        ZD_SetObjectZorder(gP.fontID, %ZD_ORDER_TOP)
        ZD_SetObjectXY(gP.fontID, z.x1 + 10, z.y1 + 10, %FALSE)
        ZD_SetObjectTextEx(gP.fontID, ZD_GetObjectImageLabel(nID), %TRUE)

        gP.currentID = nID

    end if

    function = nRet
end function

function DetectImageExtension(zFileName as ASCIIZ) as long
    local nRet as long
    if len(zFileName) then
        local sExt as string
        sExt = LCASE$(PATHNAME$(EXTN, zFileName))
        if (len(sExt)) then
            sExt += "."
            if (instr(".bmp.dib.gif.ico.jpg.jpeg.png.tif.tiff.", sExt)) then nRet = -1
        end if
    end if
    function = nRet
end function

sub GDImageSetup()
    LOCAL fd AS WIN32_FIND_DATA
    local nID, x, y, w, h, xPos, nOffset, nUse3D as long
    local hBitmap, hFind as DWORD

    local szResource as asciiz * %MAX_PATH: szResource = EXEresource()
    local szSearch as asciiz * %MAX_PATH:   PathCombine(szSearch, szResource, "*.*")
    hFind = FindFirstFile(szSearch, fd)
    if (hFind <> %INVALID_HANDLE_VALUE) then
        do
            if (ASC(fd.cFileName) <> 46) then
                select case long (fd.dwFileAttributes)
                case 0, 1, 32, 33, 128:
                     PathCombine(szSearch, szResource, fd.cFileName)
                     if (DetectImageExtension(szSearch)) then
                         hBitmap = ZI_FitBitmapFromFile(szSearch, %ClientWidth, %ClientHeight)
                         if (hBitmap) then
                             nID += 1
                             ZD_DrawBitmapToCtrl(gP.gdimage, x, y, hBitmap, &hFFFFFFFF, nID, %ZS_VISIBLE)
                             ZD_SetObjectLocked(nID, %TRUE)
                             ZD_SetObjectImageLabel(nID, PATHNAME$(NAME, szSearch))
                         end if
                     end if
                end select
            end if
        loop while (FindNextFile(hFind, fd))
        FindClose(hFind)
    end if
    gP.lastID = nID
    gP.currentID = gP.lastID

    x = 0: y = 0
    nOffset = (%ClientWidth - %ClientHeight) \ (gP.lastID - 1) + 1
    for nID = 1 to gP.lastID
         ZD_GetObjectBound(nID, w, h)
         hBitmap = ZI_CropBitmap(ZD_GetObjectBitmap(nID), (w - h) \ 2, 0, %ClientHeight, %ClientHeight, 0)
         ZD_DrawBitmapToCtrl(gP.gdimage, x, y, hBitmap, &hFFFFFFFF, nID, %ZS_VISIBLE)
         x += nOffset
    next

    PathCombine(gP.FontToUse, EXEresource(), "ft00.ttf") '// We use a private font.
    gP.fontsize = 25
    gP.fontID = gP.lastID + 1
    ZD_GetObjectXY(gP.currentID, x, y)
    nUse3D= -1
    ZD_DrawTextToCtrlEx(gP.gdimage, ZD_GetObjectImageLabel(gP.lastID), x + 10, y + 10, %ClientHeight - 20, 100, ZD_ARGB(255, 255,255,255), _
                        gP.FontToUse, gP.fontsize, gP.fontID, %ZS_VISIBLE, nUse3D, %StringAlignmentNear)
    ZD_SetObjectLocked(gP.fontID, %TRUE)

    '// IMPORTANT, this is our mouse callback, where we manage the display of the accordion.
    ZI_EventMessageEx(gP.gdimage, codeptr(MouseMoveCallBack), %WM_MOUSEMOVE, %TRUE)
end sub

'// Main winproc
function WndProc(byval hWnd as DWORD, byval uMsg as DWORD, byval wParam as DWORD, byval lParam as long) as long
    local wmId, wmEvent as long
    local ps as PAINTSTRUCT
    local hdc as DWORD

    select case long (uMsg)
    case %WM_COMMAND:
         wmId    = LO(WORD, wParam)
         wmEvent = HI(WORD, wParam)
         function = 0: exit function

    case %WM_PAINT:
         hdc = BeginPaint(hWnd, ps)
         '// TODO: process here the WM_PAINT message...
         EndPaint(hWnd, ps)
         function = 0: exit function

    case %WM_DESTROY:
         PostQuitMessage(0)
         function = 0: exit function
    end select
    function = DefWindowProc(hWnd, uMsg, wParam, lParam)
end function

function WinMain (byval hInstance as DWORD, byval hPrevInstance as DWORD, _
                  byval lpCmdLine as WSTRINGZ PTR, byval nCmdShow as long) as long

    '// Declaration of local variables
    local nRet, IsInitialized as long
    local msg as tagMSG
    local wcx as WNDCLASSEX
    local szWindowClass as STRINGZ * 16: szWindowClass = "ACCORDION"
    local szTitle as STRINGZ * 64:       szTitle = "GDImage accordion PB 32-bit"
    local hWnd as DWORD

    '// Register the main window class
    wcx.cbSize = sizeof(WNDCLASSEX)
    IsInitialized = GetClassInfoEx(hInstance, szWindowClass, wcx)
    if (IsInitialized     = 0) then
        wcx.style         = %CS_HREDRAW or %CS_VREDRAW
        wcx.lpfnWndProc   = CODEPTR(WndProc)
        wcx.cbClsExtra    = 0
        wcx.cbWndExtra    = 0
        wcx.hInstance     = hInstance
        wcx.hIcon         = %NULL
        wcx.hCursor       = LoadCursor(%NULL, byval %IDC_ARROW)
        wcx.hbrBackground = %COLOR_WINDOW + 1
        wcx.lpszMenuName  = %NULL
        wcx.lpszClassName = VARPTR(szWindowClass)
        wcx.hIconSm       = wcx.hIcon
        if (RegisterClassEx(wcx)) then IsInitialized = -1
    end if

    if (IsInitialized) then
        local r as RECT
        local dwExStyle, dwStyle as DWORD

        dwStyle = %WS_POPUP or %WS_CAPTION or %WS_SYSMENU or %WS_MINIMIZEBOX or %WS_CLIPSIBLINGS or %WS_CLIPCHILDREN
        SetRect(r, 0, 0, %ClientWidth, %ClientHeight)
        AdjustWindowRectEx(r, dwStyle, %FALSE, dwExStyle)
        local x, y, w, h as long
        w = r.right - r.left
        h = r.bottom - r.top
        x = max&((GetSystemMetrics(%SM_CXSCREEN) - w) \ 2, 0)
        y = max&((GetSystemMetrics(%SM_CYSCREEN) - h) \ 2, 0)

        hWnd = CreateWindowEx(0, _              '// Optional window styles.
                              szWindowClass, _  '// Window class
                              szTitle, _        '// Window text
                              dwStyle, _        '// Window style
                              x, y, w, h, _
                              0, _              '// Parent window
                              0, _              '// Menu
                              hInstance, _      '// Instance handle
                              byval %NULL _     '// Additional application data
                              )

       if (hWnd) then

           RegisterGDImageClass()
           gP.gdimage = CreateWindowEx(0, $GDImageClassName, "", %WS_CHILD or %WS_VISIBLE or %WS_CLIPSIBLINGS or %WS_CLIPCHILDREN, _
                                       0, 0, %ClientWidth, %ClientHeight, hWnd, %IDC_GDIMAGE, hInstance, byval %NULL)
           if (gP.gdimage) then

               '// Optional WinLIFT section
               skSkinDisable(gP.gdimage)  '// Do not skin the main GDImage control.
               local szFile as ASCIIZ * %MAX_PATH
               PathCombine(szFile, EXEpath(), "AccordionSkin.sks")
               if (skInitEngine (szFile, "")) then
                   skSkinWindow(hWnd, "Dock|Undock|Minimize|Maximize|RestoreorClose")
               end if

               GDImageSetup()
           end if

           ShowWindow(hWnd, nCmdShow)
           UpdateWindow(hWnd)

           '// Main message loop
           while (GetMessage(msg, %NULL, 0, 0))
               TranslateMessage(msg)
               DispatchMessage(msg)
           wend
           nRet = msg.wParam
       end if
    end if
    function = nRet
end function


The full PowerBASIC project is attached to this post.

...

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

Patrice Terrier

#2
For the fun, and those wanting to learn, i have also translated Accordion to WinDev 32-bit.

It is just amazing to see how easy it is, to convert code from one language to another, once you master the core API SDK programming procedural style.

I shall post the WinDev 64-bit version here, once i am done with it.

As a matter of comparison see this WinDev source code:

wcx is WNDCLASSEXA
szClass is string ASCIIZ on 16 = "WDACCORDION"

wcx.cbSize = Dimension(wcx)
IsInitialized is int =  GetClassInfoEx(Instance, szClass, wcx)
IF IsInitialized = 0 THEN
wcx.style         = CS_HREDRAW | CS_VREDRAW
wcx.lpfnWndProc   = &WndProc
wcx.cbClsExtra    = 0
wcx.cbWndExtra    = 0 // Extend_cbWndExtra * 4
wcx.hInstance     = Instance
wcx.hIcon         = Null
wcx.hCursor       = API(USER32, "LoadCursorA", Null, IDC_ARROW)
wcx.hbrBackground = Null
wcx.lpszMenuName  = Null
wcx.lpszClassName = &szClass
wcx.hIconSm       = Null
IF RegisterClassEx(wcx) THEN IsInitialized = True
END

IF IsInitialized THEN
r is RECT
uMsg is TagMSG
dwExStyle is unsigned int = 0
dwStyle is unsigned int = WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
SetRect(r, 0, 0, ClientWidth, ClientHeight)
AdjustWindowRectEx(r, dwStyle, False, dwExStyle)
w is int = r.nRight - r.nLeft
h is int = r.nBottom - r.nTop
x is int = Max((GetSystemMetrics(SM_CXSCREEN) - w) / 2, 0)
y is int = Max((GetSystemMetrics(SM_CYSCREEN) - h) / 2, 0)
hWnd is system int = CreateWindowEx(0, szClass, "GDImage Accordion", dwStyle, x, y, w, h, 0, 0, Instance, 0)
IF hWnd THEN
RegisterGDImageClass()
dwStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
gP.imageCtrl = CreateWindowEx(0, GDImageClassName, "", dwStyle, 0, 0, ClientWidth, ClientHeight, hWnd, IDC_GDIMAGE, Instance, Null)
IF (gP.imageCtrl) THEN
// Optional WinLIFT section
skSkinDisable(gP.imageCtrl) // Do not skin the main GDImage control.
sTheme is string = EXEpath() + "AccordionSkin.sks"
IF (skInitEngine (sTheme, "")) THEN
skSkinWindow(hWnd, "Dock|Undock|Minimize|Maximize|Restore|Close")
END

AccordionSetup()
END

ShowWindow(hWnd, SW_SHOW)
UpdateWindow(hWnd)

// Main message pump.
WHILE GetMessage(uMsg, Null, 0, 0)
TranslateMessage(uMsg)
DispatchMessage(uMsg)
END

END
END


...


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

Patrice Terrier

This is a WD17 64-bit project demoing the Accordion effect to be used for image presentation/selection.

This project uses only 3 DLL from the WinDev Framework:
vm64.dll, obj64.dll, std64.dll
all graphics and animations are handled by GDImage 64-bit,
and the GUI theme is managed by the GDImage/WinLIFT SkinEngine.

There is a little sound effect when playing the accordion (just move the mouse to the right or to the left), you will have to turn on the loudspeaker if you want to ear it.



You can download the full WinDev project here

All the binary files are inside of the EXE subfolder

Note : you can drag the butterfly animation with the left mouse button.

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

Patrice Terrier

The point with the 3 demos of the Accordion effect i have posted here, is to show that GDImage is able to create code that would work exactly the same with 3 different programming languages (C++, PowerBASIC, WinDev) in either 32 or 64-bit.

This is the real power of low level programming based on the core Windows flat API  ;D

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

Patrice Terrier

This is a joke i made for the WinDev community

See the WinDev collection here

I reworked them all with Photoshop, from real PC-Soft advertising.

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

Mike Stefanik

#6
WinDev objectifying women to sell a software development tool like Carl's Jr. does to sell hamburgers. Classy.

Edit: That's not meant to take anything away from your work, which I think is very cool. I'm just not a big fan of WinDev, for several reasons. How they choose to advertise just adds another reason to the list.
Mike Stefanik
sockettools.com

Patrice Terrier

#7
Mike--

See this thread:
Reminder: ANY publicity is good publicity
To say the truth i am with Victoria, and i made this demo in the hope that someone from the PC-Soft staff will see it, and understand that it is time to stop it.

The fun thing, is that there are more female using WinDev than in any other programming community i know.

______________________________________________________________

By the way, Mike, have you been able to play the demo without UAC problem?
It seems that the C++ 64-bit DLL are causing more UAC problems than the PB's 32-bit.

I am using this linker settings for manifest:
Yes (/ALLOWISOLATION)
Yes (/MANIFESTUAC:)
asInvoker (/level='asInvoker')
No (/uiAccess='false')


...

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