The project is composed of 3 parts:
1 - "gControl.inc", the low level graphic engine that sould stay unchanged.
2 - "Template.bas", the template window to use to create any new project.
3 - "custom.inc", specif code to customize the template window.
4 - "helper.inc", further helper functions needed by the project.

"Resource" folder, stores the graphic private components of the project.
"Images" folder, stores the user public images to display in the project.

History:

12-16-2013 from 09H30 to 12H30 and 13H30 to 22H44 = total 12H14
- Start building the code foundations, with the low level API(s) needed to develop the project.

12-17-2013 from 07H30 to 12H30 and 13H30 to 20H00 = total 11H30
- Start creation of the window template showing how to use the new API(s).

12-18-2013 from 03H30 to 05H00 and 09H30 to 12H30 and 13H30 to 23H30 = total 14H30
- Creation of the helper functions

12-19-2013 from 09H45 to 12H45 and 13H45 to 19H45 = total 09H00
- Code cleaning and channel painting with bitmap.

This complete the first week of work, for a total amount of 47H44

////////////////////////////////////////////////////////////////

12-20-2013 from 10H00 to 12H30 and 13H30 to 20H00 = total 09H00
Added support to create a composited image from a GOBJECT array.

The new GI_CreateImageComposited 
allows you to create on the fly a new image composed from any number of overlapping layers.

Each of the object layer must be defined first into a GOBJECT array, using any of the object listed below:
- GI_CreatePolyLineObject
- GI_CreateCurveObject
- GI_CreateRectangleObject
- GI_CreateArrowObject
- GI_CreateEllipseObject
- GI_CreateTextObject
- GI_CreateBitmapObject

The order of the array will match the z-order of the final composited bitmap, starting from bottom (1) to top (1 + n).

GI_CreateImageComposited gives you the choice to create a new disk file to save the composited image, 
or to create a memory bitmap that you can use into a gControl, or into a provided DC (GDI32).

12-21-2013 from 13H30 to 19H30 = total 06H00
Starting to work of the low level mouse support.

12-22-2013 from 13H30 to 17H30 = total 04H00
Completion of the low level mouse support and object detection.

12-23-2013 from 13H30 to 18H30 = 05H00
Full callback implementation, to process specific messages.

Here are the list of API that have been added to the projec for the purpose of handling sprite/object
and dragg them with the mouse. 
The GI_EventMessageEx API is responsible to setup all the WM_MESSAGE event callback(s).

 GI_IsKeyDown
 GI_IsShiftKeyPressed
 gSetObjectFocusID
 GI_UpdateWindow
 gCheckScrollBar
 gGetToolToUse 
 gFlagMouseCapture
 gMovingSpriteItem
 GI_ReleaseCapture
 CropRect
 WhichCursorToUse
 DrawCropRect
 gDisableTool
 GI_DisableCropRectangle
 gCropPopupText
 GI_GetZoomValue
 GI_GetImageSizeFromControl
 gCropCoordinates
 Usetool
 GD_GetObjectLocked
 GD_GetObjectSelected
 gMouseOverObjectID
 GI_MouseOverObjectID
 GI_IsCtrlKeyPressed
 GI_ClearObjectSelected
 SetManualSelection
 GI_SetManualSelection
 GI_GetManualSelection
 ClearObjectSelected
 GD_SetObjectSelected  
 gMouseHoverBoundID
 gGetRValue
 gGetGValue
 gGetBValue
 GD_ColorARGB
 GD_FillRect
 gBuildDIBvector
 gpSetImageAlpha
 GI_AlphaBlendEx
 CheckForObject
 GI_IsLButtonDown
 GD_SetObjectLocked
 gDrawFourBoundObject
 GD_DrawRectangleToCtrl
 GD_DrawArrowToCtrl
 GD_DrawEllipseToCtrl
 GI_EventMessageEx
 GD_GetObjectXY 
 GD_SetObjectXY 
 GD_GetObjectBound
 GD_GetObjectProperties
 GD_SetObjectProperties
 GD_UpdatePoints

You can see an example on how to use the callback in the "custom.inc",
and the processing of the WM_MOUSEMOVE here:

function Add_gControl_04(byval x as long, byval y as long, byval w as long, byval h as long, byref bmW as long, byref bmH as long) as DWORD
    local hCtrl as DWORD, ws as string, hBitmap as long
    '// Create a new graphic gControl child window container.
    hCtrl  = gControl(x, y, w, h, %IDC_4, %ANCHOR_HEIGHT_WIDTH, %WS_BORDER)

    '// Paint the gControl background with a gradient color.
    GI_SetProperty(hCtrl, %GI_GradientTop, RGB(0,0,0))
    GI_SetProperty(hCtrl, %GI_GradientBottom, RGB(3,88,188))

    '// Tiled the transparent grid hover the gradient background
    ws = gs_Resource + "grid.png"
    hBitmap = GI_CreateTiledBitmapFromFile (ws, 1920, 640)
    GD_DrawBitmapToCtrl(hCtrl, 0, 0, hBitmap, &HFF000000, %ID_TILED_GRID, %GS_VISIBLE)
    GD_SetObjectLocked(%ID_TILED_GRID, %TRUE)

    ws = gs_Resource + "bullet.png"
    local K, UB as long
    UB = %MAX_POINTS - 1
    DIM pXY(UB) as POINTS
    for K = 0 TO UB
        pXY(K).x = K * 38 + 20: pXY(K).y = RND(20, 100)
        if (K = 0) then
'//            hBitmap = GI_CreateBitmapFromFile(ws, bmW, bmH)
'//            GD_DrawBitmapToCtrl(hCtrl, pXY(K).x - bmH \ 2, pXY(K).y - bmH \ 2, hBitmap, &HFF000000, %ID_POLYLINE + K + 1, %GS_VISIBLE)

'// We draw a dot ellipse instead of using a bitmap
bmH = 13 '// That's the size of our DOT
GD_DrawEllipseToCtrl (hCtrl, pXY(K).x - bmH \ 2, pXY(K).y - bmH \ 2, pXY(K).x - bmH \ 2 + bmH, pXY(K).y - bmH \ 2 + bmH, _
                      GD_ARGB(255, 255,0,0), 0, %ID_POLYLINE + K + 1, %GS_VISIBLE, %GD_DRAW_FILLED, 0)
        else // We use clone to save memory.
            GD_CloneObject(%ID_POLYLINE + 1, %ID_POLYLINE + K + 1, pXY(K).x - bmH \ 2, pXY(K).y - bmH \ 2)
        end if
    next
    GD_DrawPolyLineToCtrl(hCtrl, VARPTR(pXY(0)), %MAX_POINTS, GD_ARGB(255, 100,250,150), 3, %ID_POLYLINE, %GS_VISIBLE, %GD_DRAW_OUTLINE OR %GD_DRAW_OPEN, 0)
    GD_SetObjectZorder(%ID_POLYLINE, %GD_ORDER_BOTTOM)
    GD_SetObjectZorder(%ID_TILED_GRID, %GD_ORDER_BOTTOM)
    erase pXY()

    '// Create a callback to monitor the %WM_MOUSEMOVE event in order to redraw the polyline
    local lpCallBack as DWORD: lpCallBack = codeptr(gControlCallBack)
    GI_EventMessageEx(hCtrl, lpCallBack, %WM_MOUSEMOVE, %TRUE)

    function = hCtrl
end function
'// End of customization section

and the callback itself:

function gControlCallBack(BYVAL hWnd as DWORD, byval uMsg as DWORD, byval wParam as DWORD, byval lParam as DWORD) as long
    local nRet, nObjectID as long

    nRet = %FALSE '// Do not stop the event processing in the specific gControl

    nObjectID = GI_MouseOverObjectID()

    select case long (uMsg)

    case %WM_MOUSEMOVE:
         '// Shall we redraw the polyline
         if ((nObjectID > %ID_POLYLINE AND nObjectID < %ID_TILED_GRID) AND GI_IsLButtonDown()) then
             RedrawPolyline(hWnd)
         end if
    end select
    function = nRet
end function

Version from 01-17-2014
from 01-14-2014 to 01-17-2014 = total time amount 19h30
Implementing new features to perform the pattern resizing on the fly.
New API:
- GD_SetObjectTextEx (gControl.inc)
- SetHitCursor (custom.inc)
- TestHit (custom.inc)
New callback:
- gControlCallBack_03 (custom.inc) to resize/redraw the pattern on the fly.
- gControlCallBack_04 (custom.inc) to redraw the polyline.


02-04-2014
00H30 spent to search and create the LED example posted via e-mail = 00H30
02-04-2010
working on the pattern grid alignment from 07h30 to 11H00 = 03H30
02-05-2010
completion of channel 2 (grid alignment) from 10h30 to 12h30 and 13h30 to 14h30 = 03H00
