Fresh IDE . Check-in [6639367637]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:A lot of changes as a result of activated work on Fresh v3.x

TToolbar control implemented. In very primitive state, but works somehow.

New StrNormalizePath2 function, together with the OS dependent path functions IsPathRelative and GetPrefix. They are aimed to provide OS independent way for path processing.

Fixed serious bugs in the GUI part, related to windows nested in more than 2 levels. It turned that the library was never tested with such windows before...

A lot of new functionality and correct behavior in the GUI part. Now the TAction accelerator keys are assigned through the StrToAccelerator function directly from the templates.

Timelines: family | ancestors | descendants | both | NoCanvasGUI
Files: files | file ages | folders
SHA1:6639367637f7e8da837867d073875ef7ae937cb5
User & Date: johnfound 2019-05-07 21:38:24
Context
2019-05-09
12:49
Added userID field for the menu items. TMenu:InsertItem implemented. Better and readable menu template syntax. TButton:Menu for easy attach of menu to button. check-in: edb12bf679 user: johnfound tags: NoCanvasGUI
2019-05-07
21:38
A lot of changes as a result of activated work on Fresh v3.x

TToolbar control implemented. In very primitive state, but works somehow.

New StrNormalizePath2 function, together with the OS dependent path functions IsPathRelative and GetPrefix. They are aimed to provide OS independent way for path processing.

Fixed serious bugs in the GUI part, related to windows nested in more than 2 levels. It turned that the library was never tested with such windows before...

A lot of new functionality and correct behavior in the GUI part. Now the TAction accelerator keys are assigned through the StrToAccelerator function directly from the templates. check-in: 6639367637 user: johnfound tags: NoCanvasGUI

2019-05-03
21:00
Work on TAsmEdit, related to the text editing.

Work on TMenu - implemented menu template similar to the old CoolMenu and procedure MenuFromTemplate that creates the whole menu tree from the template.

The functions "read" and "write" removed from the pthreads import library, because in conflict with FASM interface procedures. I am not sure why these functions are there, but they are not used after all. check-in: f313647175 user: johnfound tags: NoCanvasGUI

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/data/strlib.asm.

3603
3604
3605
3606
3607
3608
3609














































































































3610
3611
3612
3613
3614
3615
3616
;        stosd
;        mov     [edx+string.len], esi
;        popf
        popad
        return

endp

















































































































;******************************************************
; Computes MD5 hash of the string .hString and returns
; new string handle in eax containing the hash of the
; string.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
;        stosd
;        mov     [edx+string.len], esi
;        popf
        popad
        return

endp




; Normalizes some path to the minimal possible path.
; Removes ".." and "." from the path in all cases. In the incorrect cases the result path
;         is of course not equivalent to the beginning.
;
; Arguments:
;   .hPath - handle or pointer of string with the path. The processing is in-place and
;            the result string is always shorter or equal to the input string.
;            If the string is in memory, it MUST be in the format of FreshLib string
;            (i.e. on the offset -4 to be placed the length of the string and the
;             string to be terminated at least with dword of 0) The length of the string
;             is not used, but is updated with the result string length.
;
;   .separators - the first two bytes of this argument specifies two possible directory
;            separators. For example "/\" will accept both slashes as a valid separators.
;            all separators in the result string will be converted to the first of them.
;            These two characters should be equal if only one separator is to be used.
; Returns:
;    Nothing. Preserves all registers.
;
; Note: StrNormalizePath2 is more "paranoid" about the invalid paths than StrNormalizePath
;       it removes ".." and "." even if the result path is not equivalent.

proc StrNormalizePath2, .hPath, .separators
.back dd ?
begin
        pushad

        mov     ebx, esp

        stdcall StrPtr, [.hPath]
        mov     esi, eax
        mov     edi, eax
        mov     edx, eax
        xor     eax, eax
        mov     [.back], eax

        mov     cl, byte [.separators]
        mov     ch, cl
        mov     byte [.back], cl
        mov     byte [.back+2], cl
        mov     al, cl
        rol     ecx, 16
        mov     cx, '..'
        mov     byte [.back+1], cl
        rol     ecx, 8

.loop:
        shl     eax, 8
        lodsb
        stosb

        test    al, al
        jz      .end_of_string

        cmp     al, byte [.separators]
        je      .separator1
        cmp     al, byte [.separators+1]
        jne     .loop

.separator2:
        mov     al, byte [.separators]
        mov     [edi-1], al

.separator1:
        cmp     eax, ecx        ;ecx == '/../'
        je      .dir_back

        and     eax, $ffffff
        cmp     eax, [.back]    ; [.back] == '/./'
        je      .dir_remove

        push    edi
        jmp     .loop

.dir_remove:
        sub     edi, 2
        cmp     edi, edx
        cmovb   edi, edx
        jmp     .loop

.dir_back:
        cmp     esp, ebx
        cmove   edi, edx
        je      .loop

        add     esp, 4
        cmp     esp, ebx
        cmove   edi, edx
        je      .loop

        mov     edi, [esp]
        jmp     .loop

.end_of_string:

        and     dword [edi], 0
        sub     edi, edx
        mov     [edx+string.len], edi
        mov     esp, ebx

        popad
        return
endp






;******************************************************
; Computes MD5 hash of the string .hString and returns
; new string handle in eax containing the hash of the
; string.

Changes to freshlib/gui/Linux/Main.asm.

367
368
369
370
371
372
373

374
375
376
377

378
379
380
381
382
383
384
        stdcall ServeMenuMouseMove, [ebx+XMotionEvent.window], [ebx+XMotionEvent.x], [ebx+XMotionEvent.y], [ebx+XMotionEvent.state]
        jc      .finish

        mov     edi, [__MouseTarget]
        test    edi, edi
        jz      .search_target_move


        stdcall __GetRelativeXY, edi, [ebx+XMotionEvent.x], [ebx+XMotionEvent.y]
        jmp     .target_move

.search_target_move:

        exec    esi, TWindow:ChildByXY, [ebx+XMotionEvent.x], [ebx+XMotionEvent.y], TRUE
        mov     edi, eax

.target_move:
        cmp     edi, [__LastPointedWindow]
        je      .move_event








>




>







367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
        stdcall ServeMenuMouseMove, [ebx+XMotionEvent.window], [ebx+XMotionEvent.x], [ebx+XMotionEvent.y], [ebx+XMotionEvent.state]
        jc      .finish

        mov     edi, [__MouseTarget]
        test    edi, edi
        jz      .search_target_move

        ; returns coordinates in ecx, edx
        stdcall __GetRelativeXY, edi, [ebx+XMotionEvent.x], [ebx+XMotionEvent.y]
        jmp     .target_move

.search_target_move:
        ; returns coordinates in ecx, edx
        exec    esi, TWindow:ChildByXY, [ebx+XMotionEvent.x], [ebx+XMotionEvent.y], TRUE
        mov     edi, eax

.target_move:
        cmp     edi, [__LastPointedWindow]
        je      .move_event

Changes to freshlib/gui/SplitGrid.asm.

333
334
335
336
337
338
339
340

341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360

361
362
363
364









365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383

384
385
386
387
388
389
390







proc DrawSplitters, .pImage, .ptrSplitters, .x, .y, .width, .height

begin
        pushad

        mov     eax, [.x]
        mov     edx, [.y]
        add     [.width], eax
        add     [.height], edx

        lea     ebx, [.x]

        mov     esi, [.ptrSplitters]
        mov     edi, [.pImage]
        call    _DoDrawSplitters
        popad
        return
endp


;esi - pointer to TSplitRect
; edi - TImage


proc _DoDrawSplitters
begin
        lea     eax, [esi+TSplitRect.spRect]









        mov     edx, [esi+TSplitRect.type]
        add     esi, sizeof.TSplitRect

        test    edx, stNone
        jnz     .exit

        test    edx, stJustGap
        jnz     .next

        stdcall [DrawSplitter], edi, eax, edx, ebx


.next:
        call    _DoDrawSplitters  ; first
        call    _DoDrawSplitters  ; second

.exit:
        return
endp



; Returns:
;   CF=1; the splitter has been found. EAX=pointer to TSplitRect structure.
;   CF=0; the splitter has not been found. EAX not changed.

proc FindSplitter, .ptrSplitters, .ptrPoint







|
>



|
|



|


|
|


<

<
|
<
>

<
<

>
>
>
>
>
>
>
>
>









|

<

|
|


|

>







333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356

357

358

359
360


361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381

382
383
384
385
386
387
388
389
390
391
392
393
394
395
396







proc DrawSplitters, .pImage, .ptrSplitters, .xDst, .yDst, .width, .height, .ofsx, .ofsy
.rect RECT
begin
        pushad

        mov     eax, [.xDst]
        mov     edx, [.yDst]
        add     [.width], eax
        add     [.height], edx

        lea     ebx, [.xDst]

        mov     esi, [.ptrSplitters]
        lea     edi, [.rect]
        call    .DoDrawSplitters
        popad
        return



; esi - pointer to TSplitRect

.DoDrawSplitters:



        lea     eax, [esi+TSplitRect.spRect]
        stdcall RectCopy, edi, eax

        mov     eax, [.ofsx]
        mov     edx, [.ofsy]
        add     [edi+RECT.left], eax
        add     [edi+RECT.top], edx
        add     [edi+RECT.right], eax
        add     [edi+RECT.bottom], edx

        mov     edx, [esi+TSplitRect.type]
        add     esi, sizeof.TSplitRect

        test    edx, stNone
        jnz     .exit

        test    edx, stJustGap
        jnz     .next

        stdcall [DrawSplitter], [.pImage], edi, edx, ebx


.next:
        call    .DoDrawSplitters  ; first
        call    .DoDrawSplitters  ; second

.exit:
        retn
endp



; Returns:
;   CF=1; the splitter has been found. EAX=pointer to TSplitRect structure.
;   CF=0; the splitter has not been found. EAX not changed.

proc FindSplitter, .ptrSplitters, .ptrPoint

Changes to freshlib/gui/TAction.asm.

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
...
271
272
273
274
275
276
277










278
279
280
281
282
283
284
  ._icon_cache       dd ?

  param .Caption,   ._caption,    .SetCaption
  param .HintText,  ._hint_text,  .SetHintText
  param .IconIndex, ._icon_index, .SetIconIndex
  param .Enabled,   ._enabled,    .SetEnabled
  param .Checked,   ._checked,    .SetChecked
  param .AccelStr,  .GetAccelStr, NONE
  param .Icon, .GetIcon, NONE

  param .OnExecute, ._on_execute, ._on_execute
  param .OnIdle,    ._on_idle,    ._on_idle

  method .GetIcon
  method .GetAccelStr


  method .SetParent, .value

  method .SetCaption, .value
  method .SetHintText, .value
  method .SetIconIndex, .value
  method .SetEnabled, .value
................................................................................
begin
        mov     eax, [.self]
        lea     eax, [eax+TAction._accel]
        stdcall AcceleratorToStr, eax
        return
endp













method TAction.__clear_cache
begin
        push    eax edx

        mov     edx, [.self]







|







>







 







>
>
>
>
>
>
>
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
  ._icon_cache       dd ?

  param .Caption,   ._caption,    .SetCaption
  param .HintText,  ._hint_text,  .SetHintText
  param .IconIndex, ._icon_index, .SetIconIndex
  param .Enabled,   ._enabled,    .SetEnabled
  param .Checked,   ._checked,    .SetChecked
  param .Accelerator, .GetAccelStr, .SetAccelStr
  param .Icon, .GetIcon, NONE

  param .OnExecute, ._on_execute, ._on_execute
  param .OnIdle,    ._on_idle,    ._on_idle

  method .GetIcon
  method .GetAccelStr
  method .SetAccelStr, .value

  method .SetParent, .value

  method .SetCaption, .value
  method .SetHintText, .value
  method .SetIconIndex, .value
  method .SetEnabled, .value
................................................................................
begin
        mov     eax, [.self]
        lea     eax, [eax+TAction._accel]
        stdcall AcceleratorToStr, eax
        return
endp


method TAction.SetAccelStr; , .value
begin
        push    eax edx
        stdcall StrToAccelerator, [.value]
        exec    [.self], TAction:SetAccelerator, eax, edx
        pop     edx eax
        return
endp



method TAction.__clear_cache
begin
        push    eax edx

        mov     edx, [.self]

Changes to freshlib/gui/TAsmEdit.asm.

175
176
177
178
179
180
181

182
183
184
185
186
187
188
....
2402
2403
2404
2405
2406
2407
2408




















2409
2410
2411
2412
2413
2414
2415
; common methods

  method .Create, .parent
  method .Destroy

  method .__UpdateImages
  method .Resize, .newWidth, .newHeight


  method .UpdateScrollBar

  method .UpdateCaretPos


; rendering methods
................................................................................
;        exec    [.self], TAsmEdit:RectChanged2, 0

        popad
        return
endp























; parameters get/set methods

method TAsmEdit.SetOptions
begin
        pushad








>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
....
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
; common methods

  method .Create, .parent
  method .Destroy

  method .__UpdateImages
  method .Resize, .newWidth, .newHeight
  method .Move, .newX, .newY

  method .UpdateScrollBar

  method .UpdateCaretPos


; rendering methods
................................................................................
;        exec    [.self], TAsmEdit:RectChanged2, 0

        popad
        return
endp



method TAsmEdit.Move
begin
        mov     eax, [Caret.pWindow]
        push    eax
        cmp     eax, [.self]
        jne     @f
        stdcall CaretAttach, 0
@@:
        inherited [.newX], [.newY]

        pop     eax
        cmp     eax, [.self]
        jne     @f
        stdcall CaretAttach, eax
        exec    [.self], TAsmEdit:UpdateCaretPos
@@:
        return
endp


; parameters get/set methods

method TAsmEdit.SetOptions
begin
        pushad

Changes to freshlib/gui/TCanvasWindow.asm.

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126


method TCanvasWindow.__UpdateImages
begin
        pushad
        mov     esi, [.self]

        DebugMsg "TCanvasWindow update canvas."

        mov     ebx, [esi+TCanvasWindow._visible]
        mov     edi, [esi+TCanvasWindow._canvas]

        mov     ecx, [esi+TCanvasWindow._width]
        mov     edx, [esi+TCanvasWindow._height]

................................................................................
        cmp     ecx, [edi+TImage.width]
        ja      .destroy

        cmp     edx, [edi+TImage.height]
        jbe     .setwrap

.destroy:
        DebugMsg "Destroy old canvas."

        stdcall DestroyImage, edi                         ; canvas

        xor     eax, eax
        mov     [esi+TCanvasWindow._canvas], eax

        test    ebx, ebx
        jz      .exit


.create_new:

        DebugMsg "Create new canvas."

; new size - get it with x1.5 reserve in order to allow easy resizing.
;        lea     ecx, [ecx*3]
;        lea     edx, [edx*3]
;        shr     ecx, 1
;        shr     edx, 1

................................................................................
        lea     ebx, [edx+256]

        stdcall CreateImage, eax, ebx
        mov     [esi+TCanvasWindow._canvas], eax
        mov     edi, eax


        OutputValue "Canvas created: ", eax, 16, 8

.setwrap:
        mov     [edi+TImage.wrapW], ecx
        mov     [edi+TImage.wrapH], edx

.exit:
        and     [esi+TCanvasWindow._canvas_valid], 0







|







 







|












|







 







|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
...
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126


method TCanvasWindow.__UpdateImages
begin
        pushad
        mov     esi, [.self]

;        DebugMsg "TCanvasWindow update canvas."

        mov     ebx, [esi+TCanvasWindow._visible]
        mov     edi, [esi+TCanvasWindow._canvas]

        mov     ecx, [esi+TCanvasWindow._width]
        mov     edx, [esi+TCanvasWindow._height]

................................................................................
        cmp     ecx, [edi+TImage.width]
        ja      .destroy

        cmp     edx, [edi+TImage.height]
        jbe     .setwrap

.destroy:
;        DebugMsg "Destroy old canvas."

        stdcall DestroyImage, edi                         ; canvas

        xor     eax, eax
        mov     [esi+TCanvasWindow._canvas], eax

        test    ebx, ebx
        jz      .exit


.create_new:

;        DebugMsg "Create new canvas."

; new size - get it with x1.5 reserve in order to allow easy resizing.
;        lea     ecx, [ecx*3]
;        lea     edx, [edx*3]
;        shr     ecx, 1
;        shr     edx, 1

................................................................................
        lea     ebx, [edx+256]

        stdcall CreateImage, eax, ebx
        mov     [esi+TCanvasWindow._canvas], eax
        mov     edi, eax


;        OutputValue "Canvas created: ", eax, 16, 8

.setwrap:
        mov     [edi+TImage.wrapW], ecx
        mov     [edi+TImage.wrapH], edx

.exit:
        and     [esi+TCanvasWindow._canvas_valid], 0

Changes to freshlib/gui/TForm.asm.

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91

92
93
94
95
96



97
98
99
100
101





102
103
104
105
106
107
108
109
110
111
112
113
...
357
358
359
360
361
362
363


364
365
366
367
368
369
370
  method .EventMouseMove, .x, .y, .kbdState
  method .EventButtonPress, .button, .kbdState, .x, .y
  method .EventButtonRelease, .button, .kbdState, .x, .y

  method .Resize, .newWidth, .newHeight

  method .CloseRequest, .reason
;  method .SelfPaint, .pDstImage, .xDst, .yDst, .xSrc, .ySrc, .width, .height    ; Paints itself on the caller provided TImage.

  method .Create, .parent

endobj



;----------------------------------------------------------------------
; Interface for TForm.OnClose user handler.
................................................................................
;   CF = 0 - Destroy the object.
;
; If the OnClose event handler is not set, the form will be destroyed.
;----------------------------------------------------------------------
interface TForm.OnClose, .self, .reason


method TForm.Create
begin
        inherited [.parent]
        set     [.self], TForm:OnSelfPaint, FormOnSelfPaint
        return
endp




proc FormOnSelfPaint as TWindow.OnSelfPaint

begin
        push    eax

        stdcall DrawSolidRect,  [.pDstImage], [.xDst], [.yDst], [.width], [.height], [GUI.clDialogBk]




        mov     eax, [.self]
        mov     eax, [eax+TForm._p_split_grid]
        test    eax, eax
        jz      .finish






        lea     eax, [eax+TArray.array]
        stdcall DrawSplitters, [.pDstImage], eax, [.xDst], [.yDst], [.width], [.height]

.finish:
        pop     eax
        return
endp




method TForm.Resize        ;, .newWidth, .newHeight
................................................................................

.invalidate_splitters:

        test    [esi+TSplitRect.type], stNone
        lea     eax, [esi+TSplitRect.spRect]
        lea     esi, [esi+sizeof.TSplitRect]
        jnz     .end_spl



        exec    [.self], TForm:RectChanged2, eax
        call    .invalidate_splitters
        call    .invalidate_splitters

.end_spl:
        retn







|
<
<







 







<
<
<
<
<
<

<
<
<
<
>

<



>
>
>
|
|



>
>
>
>
>

|


|







 







>
>







51
52
53
54
55
56
57
58


59
60
61
62
63
64
65
..
72
73
74
75
76
77
78






79




80
81

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
...
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
  method .EventMouseMove, .x, .y, .kbdState
  method .EventButtonPress, .button, .kbdState, .x, .y
  method .EventButtonRelease, .button, .kbdState, .x, .y

  method .Resize, .newWidth, .newHeight

  method .CloseRequest, .reason
  method .SelfPaint, .pDstImage, .xDst, .yDst, .xSrc, .ySrc, .width, .height    ; Paints itself on the caller provided TImage.



endobj



;----------------------------------------------------------------------
; Interface for TForm.OnClose user handler.
................................................................................
;   CF = 0 - Destroy the object.
;
; If the OnClose event handler is not set, the form will be destroyed.
;----------------------------------------------------------------------
interface TForm.OnClose, .self, .reason













method TForm.SelfPaint
begin


        stdcall DrawSolidRect,  [.pDstImage], [.xDst], [.yDst], [.width], [.height], [GUI.clDialogBk]

        inherited [.pDstImage], [.xDst], [.yDst], [.xSrc], [.ySrc], [.width], [.height]

        pushad
        mov     esi, [.self]
        mov     eax, [esi+TForm._p_split_grid]
        test    eax, eax
        jz      .finish

        mov     ecx, [.xDst]
        mov     edx, [.yDst]
        sub     ecx, [.xSrc]
        sub     edx, [.ySrc]

        lea     eax, [eax+TArray.array]
        stdcall DrawSplitters, [.pDstImage], eax, [.xDst], [.yDst], [.width], [.height], ecx, edx

.finish:
        popad
        return
endp




method TForm.Resize        ;, .newWidth, .newHeight
................................................................................

.invalidate_splitters:

        test    [esi+TSplitRect.type], stNone
        lea     eax, [esi+TSplitRect.spRect]
        lea     esi, [esi+sizeof.TSplitRect]
        jnz     .end_spl

        OutputValue "Invalidate splitter Y = ", [eax+RECT.top], 10, -1

        exec    [.self], TForm:RectChanged2, eax
        call    .invalidate_splitters
        call    .invalidate_splitters

.end_spl:
        retn

Changes to freshlib/gui/TMenu.asm.

67
68
69
70
71
72
73


74
75
76
77
78
79
80
...
183
184
185
186
187
188
189

190























191
192
193
194
195
196
197
198
199
200
201
202
203
...
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
...
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
...
521
522
523
524
525
526
527


528



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543

544


545
546
547
548
549
550
551
552
...
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720












721
722
723
724
725
726
727
...
754
755
756
757
758
759
760






























































































761
762
763
764
765
766
767
...
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
...
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810

811
812
813
814
815
816
817
818
819
820
821

822
823

824
825
826
827

828
829
830
831
832
833
834

object TMenu, TCanvasWindow
  ._p_items   dd ?
  ._selected  dd ?
  .__caller   dd ?

  .__icon_size dd ?



  param .Selected, ._selected, .SetSelected
  param .Items, ._p_items, .SetItems

  method .SetSelected, .value
  method .SetItems, .menu_template
  method .SetVisible, .value
................................................................................

        stdcall GetTextBounds, "Empty menu", 10, [GUI.DefaultFont]
        add     eax, 20
        jmp     .set_width


.compute_width:

























        lea     edi, [edi+TArray.array-sizeof.TMenuItem]        ; edi points to the current TMenuItem

        xor     eax, eax
        mov     [.maxW], eax                    ; the width of the menu window
        mov     [.sumH], eax                    ; the total height of the menu window
        mov     [esi+TMenu.__icon_size], 0

.loop:
        add     edi, sizeof.TMenuItem
        dec     ecx
        js      .end_width

        cmp     [edi+TMenuItem.type], mitSeparator
................................................................................
        push    eax

        stdcall StrCat, eax, txt "  >"
        jmp     .str_width


.action:
        get     eax, [edi+TMenuItem.item], TAction:Icon
        test    eax, eax
        jz      .icon_ok

        mov     eax, [eax+TImage.height]

        cmp     eax, [esi+TMenu.__icon_size]
        jbe     .icon_ok
        mov     [esi+TMenu.__icon_size], eax

.icon_ok:

        get     eax, [edi+TMenuItem.item], TAction:AccelStr
        push    eax

        get     edx, [edi+TMenuItem.item], TAction:Caption
        stdcall StrCat, eax, edx


.str_width:
................................................................................

.action:
        mov     [.subicon], 0

        get     eax, [edi+TMenuItem.item], TAction:Caption
        mov     [.text], eax

        get     eax, [edi+TMenuItem.item], TAction:AccelStr
        mov     [.accel], eax

        get     eax, [edi+TMenuItem.item], TAction:Enabled
        mov     [.enabled], eax

        get     eax, [edi+TMenuItem.item], TAction:Icon
        mov     [.icon], eax
................................................................................
        jne     .selected_ok

        cmp     [.enabled], 0
        je      .selected_ok

        mov     eax, [.bounds.x]
        mov     edx, [.bounds.width]


        add     edx, eax




        mov     ebx, [.icon]
        test    ebx, ebx
        jz      .paint_sel

        add     eax, [ebx+TImage.width]
        add     eax, [GUI.menuIconMargin]
        add     eax, [GUI.menuIconMargin]
        add     eax, [GUI.menuIconMargin]
        add     eax, [GUI.boxBorderWidth]

        mov     ebx, [GUI.iconMenuChecked]
        add     eax, [ebx+TImage.width]

.paint_sel:

        sub     edx, eax


        stdcall DrawSolidRect, [.canvas], eax, [.y], edx, [edi+TMenuItem.height], [GUI.clMenuSelection]

.selected_ok:

; draw the icon

        cmp     [.icon], 0
        je      .icon_ok
................................................................................
method TMenu.Show
begin
        pushad

        mov     esi, [.self]
        mov     edi, [.parent]

        istype edi, TMenu
        je     .capture_ok

        stdcall SetMouseCapture, edi

.capture_ok:

        exec    edi, TWindow:ClientToScreenXY, [.x], [.y]

        mov     [esi+TMenu._x], ecx
        mov     [esi+TMenu._y], edx

        mov     [esi+TMenu.__caller], edi












        mov     [__ActiveMenu], esi

        set     esi, TMenu:Visible, TRUE
        set     esi, TMenu:Selected, 0
        popad
        return
endp
................................................................................

.finish:
        pop     edx ecx
        return
endp

































































































method TMenu.SetSelected
begin
        pushad

        mov     esi, [.self]
        mov     ecx, [.value]
................................................................................
        test    edi, edi
        jz      .finish

        cmp     ecx, [edi+TArray.count]
        jae     .finish

        mov     [esi+TMenu._selected], ecx
;        exec    esi, TWindow:Refresh

; compute Y coordinate

        lea     edi, [edi+TArray.array]
        xor     ebx, ebx

.loop:
................................................................................

.height_ok:

        mov     eax, ebx
        add     eax, [edi+TMenuItem.height]
        exec    esi, TMenu:RectChanged2, 0;, ebx, [esi+TWindow._width], eax

; hide old menu if active:

        cmp     [__ActiveMenu], esi
        je      .hide_ok

        set     [__ActiveMenu], TWindow:Visible, FALSE
        mov     [__ActiveMenu], esi

.hide_ok:
        cmp     [edi+TMenuItem.type], mitSubmenu
        jne     .finish               ;hide_old


        get     eax, [edi+TMenuItem.item], TMenu:Enabled
        test    eax, eax
        jz      .finish

        mov     eax, [esi+TMenu._width]
        sub     eax, [GUI.menuIconMargin]

        exec    [edi+TMenuItem.item], TMenu:Show, esi, eax, ebx
;        jmp     .finish
;

;.hide_old:
;        cmp     [__ActiveMenu], esi

;        je      .finish
;
;        set     [__ActiveMenu], TWindow:Visible, FALSE
;        mov     [__ActiveMenu], esi


.finish:
        popad
        return
endp









>
>







 







>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





<







 







<
<
<
<
<
<
<
<
<
<
<
<
|







 







|







 







>
>
|
>
>
>



|

|
|
<
<
<




|
>
|
>
>
|







 







<
<
<
<
<
<
<






>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







<







 







<
<
<
<
<
<
<
<
<

<
>



|




|
|
|
>
|
<
>
|
|
|
<
>







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
...
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221

222
223
224
225
226
227
228
...
250
251
252
253
254
255
256












257
258
259
260
261
262
263
264
...
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
...
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
...
719
720
721
722
723
724
725







726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
...
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
...
889
890
891
892
893
894
895

896
897
898
899
900
901
902
...
909
910
911
912
913
914
915









916

917
918
919
920
921
922
923
924
925
926
927
928
929
930

931
932
933
934

935
936
937
938
939
940
941
942

object TMenu, TCanvasWindow
  ._p_items   dd ?
  ._selected  dd ?
  .__caller   dd ?

  .__icon_size dd ?

  ._ActiveSubmenu dd ?

  param .Selected, ._selected, .SetSelected
  param .Items, ._p_items, .SetItems

  method .SetSelected, .value
  method .SetItems, .menu_template
  method .SetVisible, .value
................................................................................

        stdcall GetTextBounds, "Empty menu", 10, [GUI.DefaultFont]
        add     eax, 20
        jmp     .set_width


.compute_width:
; first scan for the icon height

        lea     edx, [edi+TArray.array-sizeof.TMenuItem]
        mov     [esi+TMenu.__icon_size], 0

.loop_icon:
        add     edx, sizeof.TMenuItem
        dec     ecx
        js      .height_ok

        cmp     [edx+TMenuItem.type], mitAction
        jne     .loop_icon

        get     eax, [edx+TMenuItem.item], TAction:Icon
        test    eax, eax
        jz      .loop_icon

        mov     eax, [eax+TImage.height]
        cmp     eax, [esi+TMenu.__icon_size]
        cmovb   eax, [esi+TMenu.__icon_size]
        mov     [esi+TMenu.__icon_size], eax
        jmp     .loop_icon

.height_ok:
        mov     ecx, [edi+TArray.count]
        lea     edi, [edi+TArray.array-sizeof.TMenuItem]        ; edi points to the current TMenuItem

        xor     eax, eax
        mov     [.maxW], eax                    ; the width of the menu window
        mov     [.sumH], eax                    ; the total height of the menu window


.loop:
        add     edi, sizeof.TMenuItem
        dec     ecx
        js      .end_width

        cmp     [edi+TMenuItem.type], mitSeparator
................................................................................
        push    eax

        stdcall StrCat, eax, txt "  >"
        jmp     .str_width


.action:












        get     eax, [edi+TMenuItem.item], TAction:Accelerator
        push    eax

        get     edx, [edi+TMenuItem.item], TAction:Caption
        stdcall StrCat, eax, edx


.str_width:
................................................................................

.action:
        mov     [.subicon], 0

        get     eax, [edi+TMenuItem.item], TAction:Caption
        mov     [.text], eax

        get     eax, [edi+TMenuItem.item], TAction:Accelerator
        mov     [.accel], eax

        get     eax, [edi+TMenuItem.item], TAction:Enabled
        mov     [.enabled], eax

        get     eax, [edi+TMenuItem.item], TAction:Icon
        mov     [.icon], eax
................................................................................
        jne     .selected_ok

        cmp     [.enabled], 0
        je      .selected_ok

        mov     eax, [.bounds.x]
        mov     edx, [.bounds.width]

        add     eax, [GUI.boxBorderWidth]
        sub     edx, [GUI.boxBorderWidth]
        sub     edx, [GUI.boxBorderWidth]

        stdcall DrawSolidRect, [.canvas], eax, [.y], edx, [edi+TMenuItem.height], [GUI.clMenuSelection]

        mov     ebx, [.icon]
        test    ebx, ebx
        jz      .selected_ok

        mov     edx, [ebx+TImage.width]
        add     edx, [GUI.menuIconMargin]




        mov     ebx, [GUI.iconMenuChecked]
        add     eax, [ebx+TImage.width]

        mov     ebx, [GUI.menuIconMargin]
        add     eax, ebx
        shr     ebx, 1
        add     eax, ebx

        stdcall DrawSolidRect, [.canvas], eax, [.y], edx, [edi+TMenuItem.height], [GUI.clMenuSelIcon]

.selected_ok:

; draw the icon

        cmp     [.icon], 0
        je      .icon_ok
................................................................................
method TMenu.Show
begin
        pushad

        mov     esi, [.self]
        mov     edi, [.parent]








        exec    edi, TWindow:ClientToScreenXY, [.x], [.y]

        mov     [esi+TMenu._x], ecx
        mov     [esi+TMenu._y], edx

        mov     [esi+TMenu.__caller], edi
        istype  edi, TMenu
        jne     .submenu_ok

        mov     eax, esi
        xchg    eax, [edi+TMenu._ActiveSubmenu]
        test    eax, eax
        jz      .submenu_ok

        set     eax, TMenu:Visible, FALSE
        stdcall SetMouseCapture, edi

.submenu_ok:
        mov     [__ActiveMenu], esi

        set     esi, TMenu:Visible, TRUE
        set     esi, TMenu:Selected, 0
        popad
        return
endp
................................................................................

.finish:
        pop     edx ecx
        return
endp


; Converts the string representation of an accelerator key to
; TFastKey structure.
;
; Returns:
;   eax - keyboard flags (TFastKey.flags)
;   edx - keyboard key (TFastKey.key)
;
; ToDo: more modifiers need to be processed

proc StrToAccelerator, .hString
.res TFastKey
begin
        pushad

        stdcall StrSplitList, [.hString], "+", FALSE
        mov     edx, eax
        xor     ecx, ecx
        mov     [.res.flags], ecx
        mov     [.res.key], ecx

.loop:
        cmp     ecx, [edx+TArray.count]
        jae     .finish

        mov     ebx, Ctrl
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], txt "Ctrl"
        jc      .setflag
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], txt "Control"
        jc      .setflag
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], txt "Ctl"
        jc      .setflag

        mov     ebx, Alt
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], txt "Alt"
        jc      .setflag

        mov     ebx, Shift
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], txt "Shift"
        jc      .setflag

        stdcall StrLenUtf8, [edx+TArray.array + 4*ecx], -1
        cmp     eax, 1
        je      .setkey

; search the key in the key-names.
        mov     esi, __FunctionalKeyNames

.key_loop:
        cmp     word [esi], 0
        je      .next           ; ignore not found

        movzx   eax, word [esi+2]
        add     eax, esi
        stdcall StrCompNoCase, [edx+TArray.array + 4*ecx], eax
        jc      .found

        add     esi, 4
        jmp     .key_loop

.found:
        movzx   eax, word [esi]
        mov     [.res.key], eax
        or      [.res.flags], fkScancode
        jmp     .next

.setkey:
        stdcall StrPtr, [edx+TArray.array + 4*ecx]
        push    edx
        stdcall DecodeUtf8, [eax]
        pop     edx
        mov     [.res.key], eax
        and     [.res.flags], not fkScancode
        jmp     .next

.setflag:
        or      [.res.flags], ebx

.next:
        inc     ecx
        jmp     .loop

.finish:
        stdcall ListFree, edx, StrDel

        mov     eax, [.res.flags]
        mov     edx, [.res.key]
        mov     [esp+4*regEAX], eax
        mov     [esp+4*regEDX], edx
        popad
        return
endp




method TMenu.SetSelected
begin
        pushad

        mov     esi, [.self]
        mov     ecx, [.value]
................................................................................
        test    edi, edi
        jz      .finish

        cmp     ecx, [edi+TArray.count]
        jae     .finish

        mov     [esi+TMenu._selected], ecx


; compute Y coordinate

        lea     edi, [edi+TArray.array]
        xor     ebx, ebx

.loop:
................................................................................

.height_ok:

        mov     eax, ebx
        add     eax, [edi+TMenuItem.height]
        exec    esi, TMenu:RectChanged2, 0;, ebx, [esi+TWindow._width], eax










        cmp     [edi+TMenuItem.type], mitSubmenu

        jne     .hide_old

        get     eax, [edi+TMenuItem.item], TMenu:Enabled
        test    eax, eax
        jz      .hide_old

        mov     eax, [esi+TMenu._width]
        sub     eax, [GUI.menuIconMargin]

        exec    [edi+TMenuItem.item], TMenu:Show, esi, eax, ebx ; will hide the previous open submenu!
        jmp     .finish

; hide old menu if active:
.hide_old:

        cmp     [esi+TMenu._ActiveSubmenu], 0
        je      .finish

        set     [esi+TMenu._ActiveSubmenu], TWindow:Visible, FALSE

        and     [esi+TMenu._ActiveSubmenu], 0

.finish:
        popad
        return
endp


Changes to freshlib/gui/TScrollable.asm.

108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
        mov     [esi+TScrollable._BackGroundV], eax

        test    ebx, ebx
        jz      .finish

.create_new:

        DebugMsg "TScrollable create background TImages!"

        mov     ecx, [GUI.scrollWidth]

        stdcall CreateImage, [ebx+TImage.width], ecx
        mov     [esi+TScrollable._BackGroundH], eax

        stdcall CreateImage, ecx, [ebx+TImage.height]
................................................................................
; draw the slider Y

        lea     eax, [esi+TScrollable._scrY]
        stdcall _SliderPixels2, eax, [.rectY.height]

        mov     edi, [esi+TScrollable._scrY.state]

        OutputValue "Length Y:", [.rectY.height], 10, -1
        OutputValue "Pos Y:", eax, 10, -1
        OutputValue "Page Y:", edx, 10, -1

        mov     ecx, [.rectY.height]
        sub     ecx, edx
        cmp     eax, ecx
        cmovg   eax, ecx

        mov     ecx, [esi+TScrollable._scrY.pos]







|







 







|
|
|







108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
        mov     [esi+TScrollable._BackGroundV], eax

        test    ebx, ebx
        jz      .finish

.create_new:

;        DebugMsg "TScrollable create background TImages!"

        mov     ecx, [GUI.scrollWidth]

        stdcall CreateImage, [ebx+TImage.width], ecx
        mov     [esi+TScrollable._BackGroundH], eax

        stdcall CreateImage, ecx, [ebx+TImage.height]
................................................................................
; draw the slider Y

        lea     eax, [esi+TScrollable._scrY]
        stdcall _SliderPixels2, eax, [.rectY.height]

        mov     edi, [esi+TScrollable._scrY.state]

;        OutputValue "Length Y:", [.rectY.height], 10, -1
;        OutputValue "Pos Y:", eax, 10, -1
;        OutputValue "Page Y:", edx, 10, -1

        mov     ecx, [.rectY.height]
        sub     ecx, edx
        cmp     eax, ecx
        cmovg   eax, ecx

        mov     ecx, [esi+TScrollable._scrY.pos]

Added freshlib/gui/TToolbar.asm.















































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "BSD 2-clause" license."          |
;|_______________________________________________________________________________________|
;
;  Description: TToolbar object class
;
;  Target OS: Any
;
;  Dependencies:
;
;  Notes: Represents GUI button.
;_________________________________________________________________________________________
module "TToolbar library"

tbbSeparator = 0

tbsNeutral  = bsNeutral
tbsHovered  = bsHovered
tbsPressed  = bsPressed
tbsDisabled = bsDisabled


struct TToolButton
  .action dd ?          ; can be pointer to TAction object, or TMenu or tbbSeparator (0)
  .state  dd ?
  .width  dd ?
ends


object TToolbar, TWindow

; private fields

  ._canvas       dd ?
  ._canvas_valid dd ?

  ._btn_height   dd ?

  ._buttons     dd ?            ; TArray of TToolButton structures.

; methods

  method .Create, .Parent
  method .ForceRefresh

  method .HitTest, .x, .y
  method .ClearState

  method .AddButton, .action

  method ._RenderView

  method .SelfPaint, .pDstImage, .xDst, .yDst, .xSrc, .ySrc, .width, .height

  method .Autosize

  ; system events methods

  method .EventMouseEnter
  method .EventMouseLeave
  method .EventMouseMove, .x, .y, .kbdState

  method .EventButtonPress, .button, .kbdState, .x, .y
  method .EventButtonRelease, .button, .kbdState, .x, .y

endobj


interface TToolbar.OnClick, .self, .button


; new

method TToolbar.Create
begin
        inherited [.Parent]
        push    esi

        mov     esi, [.self]
        mov     [esi+TToolbar._cursor], mcHand
        mov     [esi+TToolbar.__want_focus], FALSE

        stdcall CreateArray, sizeof.TToolButton
        mov     [esi+TToolbar._buttons], eax
        mov     [esi+TToolbar._btn_height], 24

        pop     esi
        return
endp



method TToolbar.ForceRefresh
begin
        mov     eax, [.self]
        and     [eax+TToolbar._canvas_valid], 0
        inherited
        return
endp


method TToolbar.SelfPaint
begin
        pushad
        mov     esi, [.self]

        cmp     [esi+TToolbar._canvas_valid], 0
        jne     @f
        exec    esi, TToolbar:_RenderView
@@:
        mov     ebx, [esi+TToolbar._canvas]
        test    ebx, ebx
        jz      .finish

        stdcall BlendImage, [.pDstImage], [.xDst], [.yDst], ebx, [.xSrc], [.ySrc], [.width], [.height]

.finish:
        popad
        inherited [.pDstImage], [.xDst], [.yDst], [.xSrc], [.ySrc], [.width], [.height]
        return
endp


method TToolbar.HitTest
begin
        pushad

        mov     esi, [.self]
        mov     edi, [esi+TToolbar._buttons]
        mov     ecx, [edi+TArray.count]
        lea     edi, [edi+TArray.array]

.loop:
        dec     ecx
        js      .not_found

        mov     eax, [edi+TToolButton.width]
        cmp     [.x], eax
        jl      .found

        sub     [.x], eax
        add     edi, sizeof.TToolButton
        jmp     .loop

.found:
        cmp     [edi+TToolButton.action], 0
        je      .not_found

        mov     [esp+4*regEAX], edi
        clc
        popad
        return

.not_found:
        stc
        popad
        return
endp


method TToolbar.AddButton
begin
        pushad

        mov     esi, [.self]
        mov     edx, [esi+TToolbar._buttons]
        mov     ecx, [.action]

        stdcall AddArrayItems, edx, 1
        mov     [esi+TToolbar._buttons], edx

        test    ecx, ecx
        cmovz   edx, [GUI.tbSeparatorWidth]
        cmovnz  edx, [esi+TToolbar._btn_height]

        mov     [eax+TToolButton.action], ecx
        mov     [eax+TToolButton.state], tbsNeutral
        mov     [eax+TToolButton.width], edx

        exec    esi, TToolbar:ForceRefresh
        popad
        return
endp



method TToolbar.ClearState
begin
        pushad
        mov     esi, [.self]
        mov     edi, [esi+TToolbar._buttons]
        mov     ecx, [edi+TArray.count]
        lea     edi, [edi+TArray.array]

.loop:
        dec     ecx
        js      .finish

        mov     [edi+TToolButton.state], tbsNeutral
        add     edi, sizeof.TToolButton
        jmp     .loop

.finish:
        popad
        return
endp



method TToolbar._RenderView
begin
        pushad

        mov     esi, [.self]
        mov     edi, [esi+TToolbar._buttons]
        mov     ecx, [edi+TArray.count]
        jecxz   .finish

        mov     ebx, [esi+TToolbar._canvas]
        test    ebx, ebx
        jnz     .canvas_ok

        mov     eax, ecx
        imul    eax, [esi+TToolbar._btn_height]
        stdcall CreateImage, eax, [esi+TToolbar._btn_height]
        mov     [esi+TToolbar._canvas], eax
        mov     ebx, eax

.canvas_ok:

        lea     edi, [edi + TArray.array]
        xor     edx, edx

.loop:
        dec     ecx
        js      .finish

        stdcall DrawToolbarBtn, ebx, edi, edx, 0, [esi+TToolbar._btn_height]

        add     edx, [edi+TToolButton.width]
        add     edi, sizeof.TToolButton
        jmp     .loop


.finish:
        popad
        return
endp




proc DrawToolbarBtn, .canvas, .pButton, .x, .y, .height
.bounds TBounds
begin
        pushad
        mov     edi, [.pButton]

        mov     eax, [.x]
        mov     ecx, [.y]
        mov     [.bounds.x], eax
        mov     [.bounds.y], ecx

        mov     eax, [edi+TToolButton.width]
        mov     ecx, [.height]
        mov     [.bounds.width], eax
        mov     [.bounds.height], ecx

        mov     ebx, [edi+TToolButton.state]

        lea     eax, [.bounds]
        stdcall DrawBoxDefault, [.canvas], eax, [GUI.clToolBtnBk+4*ebx], [GUI.tbBorder+4*ebx], [GUI.tbBorderWidth]

        cmp     [edi+TToolButton.action], 0
        je      .draw_separator

        istype  [edi+TToolButton.action], TAction
        jne     .finish

        add     [.bounds.x], 4
        add     [.bounds.y], 4

        mov     eax, [GUI.tbPressedOfsX]
        mov     edx, [GUI.tbPressedOfsY]

        cmp     [edi+TToolButton.state], tbsHovered
        jne     @f
        neg     eax
        neg     edx
@@:
        cmp     [edi+TToolButton.state], tbsPressed
        je      @f
        cmp     [edi+TToolButton.state], tbsHovered
        je      @f
        xor     eax, eax
        xor     edx, edx
@@:
        add     [.bounds.x], eax
        add     [.bounds.y], edx

        get     ecx, [edi+TToolButton.action], TAction:Icon
        test    ecx, ecx
        jz      .finish

        stdcall BlendImage, [.canvas], [.bounds.x], [.bounds.y], ecx, 0, 0, [ecx+TImage.width], [ecx+TImage.height]

.finish:
        popad
        return

.draw_separator:

        mov     ecx, [edi+TToolButton.width]
        sub     ecx, 2
        sub     [.bounds.height], ecx
        shr     ecx, 1
        add     [.bounds.x], ecx
        add     [.bounds.y], ecx
        mov     [.bounds.width], 2

        lea     eax, [.bounds]
        stdcall DrawBoxDefault, [.canvas], eax, 0, [GUI.tbSeparatorType], 1
;        stdcall DrawSolidRect, [.canvas], ecx, [.bounds.y], 2, [.bounds.height], [GUI.clToolSeparator]
;        stdcall DrawSolidRect, [.canvas], [.bounds.x], 0, [edi+TToolButton.width], 2, clAlizarin

        jmp     .finish


endp



method TToolbar.Autosize
begin
        inherited
        mov     edx, [.self]
        mov     edx, [edx+TToolbar._btn_height]
        return
endp



method TToolbar.EventMouseEnter
begin
;        exec    [.self], TToolbar:SimpleSetParam, 0, TToolbar._state, bsHovered
        inherited
        return
endp


method TToolbar.EventMouseLeave
begin
        exec    [.self], TToolbar:ClearState
        exec    [.self], TToolbar:ForceRefresh
        inherited
        return
endp


method TToolbar.EventMouseMove
begin
        test    [.kbdState], maskBtnLeft
        jnz     .exit

        exec    [.self], TToolbar:ClearState
        exec    [.self], TToolbar:HitTest, [.x], [.y]
        jc      .finish

        mov     [eax+TToolButton.state], bsHovered

.finish:
        exec    [.self], TToolbar:ForceRefresh

.exit:
        inherited [.x], [.y], [.kbdState]
        return
endp


method TToolbar.EventButtonPress
begin
        exec    [.self], TToolbar:ClearState
        exec    [.self], TToolbar:HitTest, [.x], [.y]
        jc      .finish

        mov     [eax+TToolButton.state], bsPressed
        stdcall SetMouseCapture, [.self]

.finish:
        exec    [.self], TToolbar:ForceRefresh
        return
endp



method TToolbar.EventButtonRelease
begin
        pushad
        stdcall SetMouseCapture, 0

        mov     esi, [.self]
        mov     edi, [esi+TToolbar._buttons]
        mov     ecx, [edi+TArray.count]
        lea     edi, [edi+TArray.array]

.loop:
        dec     ecx
        js      .finish

        cmp     [edi+TToolButton.state], tbsPressed
        je      .end_scan

        add     edi, sizeof.TToolButton
        jmp     .loop

.end_scan:
        exec    esi, TToolbar:HitTest, [.x], [.y]
        jc      .finish

        cmp     eax, edi
        jne     .finish

        mov     [edi+TToolButton.state], bsHovered
        exec    esi, TToolbar:ForceRefresh

        istype  [edi+TToolButton.action], TAction
        jne     .finish

        exec    [edi+TToolButton.action], TAction:Execute, esi

.finish:
        popad
        return
endp



endmodule

Changes to freshlib/gui/TTreeView.asm.

259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
...
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
        mov     esi, [.pTreeView]
        mov     ebx, [.pItem]

        mov     eax, [ebx+TTreeViewItem.xwidth]
        cmp     eax, [esi+TTreeView._max_width]
        jle     @f
        mov     [esi+TTreeView._max_width], eax
        OutputValue "Max width:", eax, 10, -1
@@:

        mov     esi, [esi+TTreeView._items]
        lea     esi, [esi+TArray.array]

        mov     edi, [.user]
        sub     ebx, esi
................................................................................

method TTreeView.__RenderView
.bounds TBounds
.end_item dd ?
begin
        pushad

if defined options.DebugMode & options.DebugMode
        stdcall  GetFineTimestamp
        push     eax
end if

        mov     esi, [.self]
        get     ebx, esi, TTreeView:Canvas
        test    ebx, ebx
        jz      .finish

        xor     eax, eax
................................................................................
        or      ecx, bxNoFill
        stdcall [DrawBox], [esi+TTreeView._canvas], eax, [GUI.clTreeViewBack], ecx, [GUI.boxBorderWidth]


.finish:
        inherited

if defined options.DebugMode & options.DebugMode

        stdcall GetFineTimestamp
        sub     eax, [esp]
        OutputValue "TreeView.Paint time: ", eax, 10, -1
        add     esp, 4
end if

        popad
        return
endp


proc TTreeView.__PaintOneItem, .pTreeView, .pItem, .pNextItem, .hsize, .vsize, .y, .focused
................................................................................

.pgdn:
        get     edx, esi, TTreeView:PageY
        dec     edx


.move_down:
        OutputValue "Move down distance:", edx, 10, -1

        mov     edi, [esi+TTreeView._index]
        mov     ebx, [esi+TTreeView._focused]

        add     ebx, edx

        cmp     ebx, [edi+TArray.count]







|







 







|
|
|
|







 







|
|
|
|
|
|
|







 







|







259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
...
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
        mov     esi, [.pTreeView]
        mov     ebx, [.pItem]

        mov     eax, [ebx+TTreeViewItem.xwidth]
        cmp     eax, [esi+TTreeView._max_width]
        jle     @f
        mov     [esi+TTreeView._max_width], eax
;        OutputValue "Max width:", eax, 10, -1
@@:

        mov     esi, [esi+TTreeView._items]
        lea     esi, [esi+TArray.array]

        mov     edi, [.user]
        sub     ebx, esi
................................................................................

method TTreeView.__RenderView
.bounds TBounds
.end_item dd ?
begin
        pushad

;if defined options.DebugMode & options.DebugMode
;        stdcall  GetFineTimestamp
;        push     eax
;end if

        mov     esi, [.self]
        get     ebx, esi, TTreeView:Canvas
        test    ebx, ebx
        jz      .finish

        xor     eax, eax
................................................................................
        or      ecx, bxNoFill
        stdcall [DrawBox], [esi+TTreeView._canvas], eax, [GUI.clTreeViewBack], ecx, [GUI.boxBorderWidth]


.finish:
        inherited

;if defined options.DebugMode & options.DebugMode
;
;        stdcall GetFineTimestamp
;        sub     eax, [esp]
;        OutputValue "TreeView.Paint time: ", eax, 10, -1
;        add     esp, 4
;end if

        popad
        return
endp


proc TTreeView.__PaintOneItem, .pTreeView, .pItem, .pNextItem, .hsize, .vsize, .y, .focused
................................................................................

.pgdn:
        get     edx, esi, TTreeView:PageY
        dec     edx


.move_down:
;        OutputValue "Move down distance:", edx, 10, -1

        mov     edi, [esi+TTreeView._index]
        mov     ebx, [esi+TTreeView._focused]

        add     ebx, edx

        cmp     ebx, [edi+TArray.count]

Changes to freshlib/gui/TWindow.asm.

346
347
348
349
350
351
352


353
354
355
356
357
358
359
...
364
365
366
367
368
369
370


371
372





373
374
375
376
377
378
379
...
397
398
399
400
401
402
403
404
405
406
407

408
409
410



411
412
413
414
415
416
417
418
419
420
421
422
423


424
425
426
427
428
429
430
431
432
433
434
...
776
777
778
779
780
781
782

783
784
785
786
787
788
789
...
880
881
882
883
884
885
886

887
888
889
890
891
892
893
894








895
896
897
898
899
900
901
....
1298
1299
1300
1301
1302
1303
1304






1305
1306
1307
1308
1309
1310
1311
; renders the children windows on the provided TImage/rectangle.
; The implementations for the controls can use any method of paint, but must to call
; "inherited" at the end;

method TWindow.SelfPaint  ; .pDstImage, .xDst, .yDst, .xSrc, .ySrc, .width, .height
.src  RECT
.dest RECT


begin
        pushad

        mov     esi, [.self]
        stdcall LockImg, [.pDstImage]

        mov     eax, [esi+TWindow._OnSelfPaint]
................................................................................
        stdcall eax, esi, [.pDstImage], [.xDst], [.yDst], [.xSrc], [.ySrc], [.width], [.height]
        pop     esi

.user_event_processed:

; The source rectangle:



        mov     ecx, [.xSrc]
        mov     edx, [.ySrc]





        mov     [.src.left], ecx
        mov     [.src.top], edx
        add     ecx, [.width]
        add     edx, [.height]
        mov     [.src.right], ecx
        mov     [.src.bottom], edx
        lea     edi, [.src]
................................................................................
        istype  esi, TWindow
        jne     .children_loop

        get     eax, esi, TWindow:Visible
        test    eax, eax
        jz      .children_loop

        push    [esi+TWindow._x] [esi+TWindow._y] [esi+TWindow._width] [esi+TWindow._height]
        pop     [.dest.bottom] [.dest.right] [.dest.top] [.dest.left]

        mov     eax, [.dest.left]

        add     [.dest.right], eax

        mov     eax, [.dest.top]



        add     [.dest.bottom], eax

        lea     eax, [.dest]
        stdcall RectIntersect, eax, eax, edi
        jc      .children_loop                  ; the rectangles does not intersect, so the child should not to be painted.

        mov     eax, [.dest.left]
        mov     edx, [.dest.top]
        sub     [.dest.right], eax      ; source rectangle width
        sub     [.dest.bottom], edx     ; source rectangle height

        sub     eax, [esi+TWindow._x]
        sub     edx, [esi+TWindow._y]



; notice, that the children are self painted only with spBlend operation!
        exec    esi, TWindow:SelfPaint, [.pDstImage], [.dest.left], [.dest.top], eax, edx, [.dest.right], [.dest.bottom]

        jmp     .children_loop

.end_loop:
        stdcall UnlockImg, [.pDstImage]
        popad
        return
endp
................................................................................
;_________________________________________________________________________________________

;---------------------------------------------------------------------------------
; Arguments:
;   .self
;   .x
;   .y

;
; Returns:
;   eax - pointer to TWindow
;   ecx - X coordinates, translated to the client coordinates of the child.
;   edx - Y coordinates, translated to the client coordinates of the child.
;
; If children window was not found, the method returns:
................................................................................
;
; Includes the passed rectangle in the invalid rectangles list. Later this rectangle will need
; to be repainted, but only when the screen image is required.
;

method TWindow.RectChanged2      ;, .pRect


.rect   RECT
.client RECT

begin
        pushad

        mov     esi, [.self]









        get     ecx, esi, TWindow:width
        get     edx, esi, TWindow:height
        xor     eax, eax

        mov     [.client.left], eax
        mov     [.client.top], eax
        mov     [.client.right], ecx
................................................................................
        jz      .finish

        exec    edx, TWindow:RectChangedXY2, [esi+TWindow._x], [esi+TWindow._y], [esi+TWindow._width], [esi+TWindow._height]        ; previous position.

        mov     [esi+TWindow._x], ebx
        mov     [esi+TWindow._y], ecx







        exec    edx, TWindow:RectChangedXY2, [esi+TWindow._x], [esi+TWindow._y], [esi+TWindow._width], [esi+TWindow._height]       ; new position.

.finish:
        popad
        return
endp








>
>







 







>
>
|
|
>
>
>
>
>







 







|
|
<
|
>
|
<
|
>
>
>
|












>
>

<

<







 







>







 







>








>
>
>
>
>
>
>
>







 







>
>
>
>
>
>







346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
...
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
...
406
407
408
409
410
411
412
413
414

415
416
417

418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437

438

439
440
441
442
443
444
445
...
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
...
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
....
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
; renders the children windows on the provided TImage/rectangle.
; The implementations for the controls can use any method of paint, but must to call
; "inherited" at the end;

method TWindow.SelfPaint  ; .pDstImage, .xDst, .yDst, .xSrc, .ySrc, .width, .height
.src  RECT
.dest RECT
.ofsx dd ?
.ofsy dd ?
begin
        pushad

        mov     esi, [.self]
        stdcall LockImg, [.pDstImage]

        mov     eax, [esi+TWindow._OnSelfPaint]
................................................................................
        stdcall eax, esi, [.pDstImage], [.xDst], [.yDst], [.xSrc], [.ySrc], [.width], [.height]
        pop     esi

.user_event_processed:

; The source rectangle:

        mov     ecx, [.xDst]
        mov     edx, [.yDst]
        sub     ecx, [.xSrc]
        sub     edx, [.ySrc]
        mov     [.ofsx], ecx    ; .ofsx and .ofsy actually are the X and Y position of the top-left corner
        mov     [.ofsy], edx    ; of the window on the destination image.

        mov     ecx, [.xDst]
        mov     edx, [.yDst]
        mov     [.src.left], ecx
        mov     [.src.top], edx
        add     ecx, [.width]
        add     edx, [.height]
        mov     [.src.right], ecx
        mov     [.src.bottom], edx
        lea     edi, [.src]
................................................................................
        istype  esi, TWindow
        jne     .children_loop

        get     eax, esi, TWindow:Visible
        test    eax, eax
        jz      .children_loop

        mov     eax, [esi+TWindow._x]
        mov     edx, [esi+TWindow._y]

        add     eax, [.ofsx]
        add     edx, [.ofsy]
        mov     [.dest.left], eax

        mov     [.dest.top], edx
        add     eax, [esi+TWindow._width]
        add     edx, [esi+TWindow._height]
        mov     [.dest.right], eax
        mov     [.dest.bottom], edx

        lea     eax, [.dest]
        stdcall RectIntersect, eax, eax, edi
        jc      .children_loop                  ; the rectangles does not intersect, so the child should not to be painted.

        mov     eax, [.dest.left]
        mov     edx, [.dest.top]
        sub     [.dest.right], eax      ; source rectangle width
        sub     [.dest.bottom], edx     ; source rectangle height

        sub     eax, [esi+TWindow._x]
        sub     edx, [esi+TWindow._y]
        sub     eax, [.ofsx]
        sub     edx, [.ofsy]


        exec    esi, TWindow:SelfPaint, [.pDstImage], [.dest.left], [.dest.top], eax, edx, [.dest.right], [.dest.bottom]

        jmp     .children_loop

.end_loop:
        stdcall UnlockImg, [.pDstImage]
        popad
        return
endp
................................................................................
;_________________________________________________________________________________________

;---------------------------------------------------------------------------------
; Arguments:
;   .self
;   .x
;   .y
;   .onlyenabled
;
; Returns:
;   eax - pointer to TWindow
;   ecx - X coordinates, translated to the client coordinates of the child.
;   edx - Y coordinates, translated to the client coordinates of the child.
;
; If children window was not found, the method returns:
................................................................................
;
; Includes the passed rectangle in the invalid rectangles list. Later this rectangle will need
; to be repainted, but only when the screen image is required.
;

method TWindow.RectChanged2      ;, .pRect

.prect  RECT
.rect   RECT
.client RECT

begin
        pushad

        mov     esi, [.self]

        mov     ecx, [.pRect]
        jecxz   .prect_ok

        lea     eax, [.prect]
        stdcall RectCopy, eax, [.pRect]
        mov     [.pRect], eax

.prect_ok:
        get     ecx, esi, TWindow:width
        get     edx, esi, TWindow:height
        xor     eax, eax

        mov     [.client.left], eax
        mov     [.client.top], eax
        mov     [.client.right], ecx
................................................................................
        jz      .finish

        exec    edx, TWindow:RectChangedXY2, [esi+TWindow._x], [esi+TWindow._y], [esi+TWindow._width], [esi+TWindow._height]        ; previous position.

        mov     [esi+TWindow._x], ebx
        mov     [esi+TWindow._y], ecx

        istype esi, TForm
        jne    @f

        OutputValue "Form moved X:", ebx, 10, -1
        OutputValue "Form moved Y:", ecx, 10, -1
@@:
        exec    edx, TWindow:RectChangedXY2, [esi+TWindow._x], [esi+TWindow._y], [esi+TWindow._width], [esi+TWindow._height]       ; new position.

.finish:
        popad
        return
endp

Changes to freshlib/gui/all.asm.

45
46
47
48
49
50
51

52
53
54
55
56
57
58
include 'TLabel.asm'
include 'TImageLabel.asm'
include 'TMenu.asm'
include 'TProgressbar.asm'
include 'TScrollWindow.asm'
include 'TScrollable.asm'
include 'TTreeView.asm'

;include 'TGrid.asm'

include 'dialogs.asm'
include 'SplitGrid.asm'


; OS independent main procedures.







>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
include 'TLabel.asm'
include 'TImageLabel.asm'
include 'TMenu.asm'
include 'TProgressbar.asm'
include 'TScrollWindow.asm'
include 'TScrollable.asm'
include 'TTreeView.asm'
include 'TToolbar.asm'
;include 'TGrid.asm'

include 'dialogs.asm'
include 'SplitGrid.asm'


; OS independent main procedures.

Changes to freshlib/gui/themes/flat_gui.asm.

15
16
17
18
19
20
21



22
23
24
25
26
27
28
..
62
63
64
65
66
67
68


69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
..
90
91
92
93
94
95
96










97
98
99
100
101
102
103
...
145
146
147
148
149
150
151

152
153
154
155
156
157
158
;_________________________________________________________________________________________
module "GUI theme data and code library"

; Named theme colors

; cyan
clTurquoise = $ff1abc9c



clGreenSea  = $ff16A085

; green
clEmerald   = $ff2ecc71
clNephritis = $ff27ae60

; blue
................................................................................
clPumpkin = $ffd35400

; Red

clAlizarin =    $ffe74c3c
clPomegranate = $ffc0392b



iglobal

        NamedArray      GUI,                                           \
\
\ ; Text caret color
                clTextCaret,       HEX, clAlizarin,                     \       ;(clAlizarin and $00ffffff) or $e0000000,                    \
                caretTimes,        NUM, <250, 250>,                    \
\ ; Widgets border colors and width
                clBorderNeutral,   HEX, clTurquoise,                   \
                clBorderLight,     HEX, clTurquoise,                   \
                clBorderDark,      HEX, clTurquoise,                   \
                clBorderNeutralGray, HEX, $ff606060,                   \
                clBorderLightGray, HEX, $ff606060,                     \
                clBorderDarkGray,  HEX, $ff606060,                     \
                clBorderFocused,   HEX, clAlizarin,                    \
\
                boxBorderWidth,  NUM, 2,                               \
\
\ ; TButton colors and styles. The multivalue fields are for Neutral, Hovered and Pressed states.
\
               clBtnBk,         HEX, <clTurquoise, $ff48c9b0, clGreenSea, $807b7b7b>,   \
................................................................................
               clBtnTxt,        HEX, <clWhite, clWhite, clSilver, $80ffffff>,           \
               btnBorder,       NUM, <bxNone, bxNone, bxNone, bxNone or bxDisabled>,    \
               btnPressedOfsX,  NUM, 0,                                      \
               btnPressedOfsY,  NUM, 0,                                      \
               btnMarginX,      NUM, 8,                                      \
               btnMarginY,      NUM, 8,                                      \
\










\ ; TEdit colors and styles.
\
               clEditBk,          HEX, clClouds,                             \
               clEditBkFocused,   HEX, clClouds,                             \
               clEditTxt,         HEX, $ff000000,                            \
               clEditSel,         HEX, clBelizeHole and $00ffffff or $60000000,                         \
               clEditSelTxt,      HEX, $ffffffff,                            \
................................................................................
\
\ ; TMenu colors and styles
\
              clMenuBack,         HEX, clClouds,                                             \
              clMenuText,         HEX, $ff000000,                                            \
              clMenuTextGray,     HEX, $90000000,                                            \
              clMenuSelection,    HEX, clBelizeHole,                                         \

              borderMenu,         NUM, bxFlat,                                               \
              menuIconMargin,     NUM, 4,                                                    \
              menuSeparatorHeight,NUM, 12,                                                   \
              menuMinTextDist,    NUM, 32,                                                   \
              menuSubIcon,        PNG, "%lib%/gui/images/menu/submenu.png",                  \
              menuSubIconSel,     PNG, "%lib%/gui/images/menu/submenusel.png",               \
              menuSubIconGray,    PNG, "%lib%/gui/images/menu/submenugray.png",              \







>
>
>







 







>
>









|
|

|
|







 







>
>
>
>
>
>
>
>
>
>







 







>







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
..
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
;_________________________________________________________________________________________
module "GUI theme data and code library"

; Named theme colors

; cyan
clTurquoise = $ff1abc9c
clTurquoiseL = $ff31e2bf
clTurquoiseD = $ff138670

clGreenSea  = $ff16A085

; green
clEmerald   = $ff2ecc71
clNephritis = $ff27ae60

; blue
................................................................................
clPumpkin = $ffd35400

; Red

clAlizarin =    $ffe74c3c
clPomegranate = $ffc0392b

clBelizeClouds = $ffc9dce7 ; a blend between clBelizeHole and clClouds

iglobal

        NamedArray      GUI,                                           \
\
\ ; Text caret color
                clTextCaret,       HEX, clAlizarin,                     \       ;(clAlizarin and $00ffffff) or $e0000000,                    \
                caretTimes,        NUM, <250, 250>,                    \
\ ; Widgets border colors and width
                clBorderNeutral,   HEX, clTurquoise,                   \
                clBorderLight,     HEX, clTurquoiseL,                      \
                clBorderDark,      HEX, clTurquoiseD,                  \
                clBorderNeutralGray, HEX, $ff606060,                   \
                clBorderLightGray, HEX, $ff808080,                     \
                clBorderDarkGray,  HEX, $ff404040,                     \
                clBorderFocused,   HEX, clAlizarin,                    \
\
                boxBorderWidth,  NUM, 2,                               \
\
\ ; TButton colors and styles. The multivalue fields are for Neutral, Hovered and Pressed states.
\
               clBtnBk,         HEX, <clTurquoise, $ff48c9b0, clGreenSea, $807b7b7b>,   \
................................................................................
               clBtnTxt,        HEX, <clWhite, clWhite, clSilver, $80ffffff>,           \
               btnBorder,       NUM, <bxNone, bxNone, bxNone, bxNone or bxDisabled>,    \
               btnPressedOfsX,  NUM, 0,                                      \
               btnPressedOfsY,  NUM, 0,                                      \
               btnMarginX,      NUM, 8,                                      \
               btnMarginY,      NUM, 8,                                      \
\
\ ; Toolbar buttons colors and styles
               clToolBtnBk,     HEX, <clClouds, clBelizeClouds, clBelizeClouds, clClouds>,   \
               clToolBtnTxt,    HEX, <$ff000000, $ff000000, $ff000000, $80000000>,           \
               tbBorder,        NUM, <bxNone, bxNone, bxNone, bxNone or bxDisabled>,         \
               tbBorderWidth,   NUM, 1,                                      \
               tbPressedOfsX,   NUM, 0,                                      \
               tbPressedOfsY,   NUM, 2,                                      \
               tbSeparatorType,  HEX, bxFlat or bxDisabled,                  \
               tbSeparatorWidth, NUM, 10,                                     \
\
\ ; TEdit colors and styles.
\
               clEditBk,          HEX, clClouds,                             \
               clEditBkFocused,   HEX, clClouds,                             \
               clEditTxt,         HEX, $ff000000,                            \
               clEditSel,         HEX, clBelizeHole and $00ffffff or $60000000,                         \
               clEditSelTxt,      HEX, $ffffffff,                            \
................................................................................
\
\ ; TMenu colors and styles
\
              clMenuBack,         HEX, clClouds,                                             \
              clMenuText,         HEX, $ff000000,                                            \
              clMenuTextGray,     HEX, $90000000,                                            \
              clMenuSelection,    HEX, clBelizeHole,                                         \
              clMenuSelIcon,      HEX, clBelizeClouds,                                       \
              borderMenu,         NUM, bxFlat,                                               \
              menuIconMargin,     NUM, 4,                                                    \
              menuSeparatorHeight,NUM, 12,                                                   \
              menuMinTextDist,    NUM, 32,                                                   \
              menuSubIcon,        PNG, "%lib%/gui/images/menu/submenu.png",                  \
              menuSubIconSel,     PNG, "%lib%/gui/images/menu/submenusel.png",               \
              menuSubIconGray,    PNG, "%lib%/gui/images/menu/submenugray.png",              \

Changes to freshlib/gui/themes/win_gui.asm.

42
43
44
45
46
47
48










49
50
51
52
53
54
55
..
97
98
99
100
101
102
103

104
105
106
107
108
109
110
               clBtnTxt,        HEX, <$ff000000, $ff000000, $ff000000, $ff606060>,           \
               btnBorder,       NUM, <bxRaised, bxRaised, bxSunken, bxRaised or bxDisabled>,               \
               btnPressedOfsX,  NUM, 1,                                      \
               btnPressedOfsY,  NUM, 1,                                      \
               btnMarginX,      NUM, 8,                                      \
               btnMarginY,      NUM, 8,                                      \
\










\ ; TEdit colors and styles.
\
               clEditBk,          HEX, $ffffffff,                            \
               clEditBkFocused,   HEX, $ffffffff,                            \
               clEditTxt,         HEX, $ff000000,                            \
               clEditSel,         HEX, $600a246c,                            \
               clEditSelTxt,      HEX, $ffffffff,                            \
................................................................................
\
\ ; TMenu colors and styles
\
              clMenuBack,         HEX, $ffd4d0c8,                                            \
              clMenuText,         HEX, $ff000000,                                            \
              clMenuTextGray,     HEX, $80000000,                                            \
              clMenuSelection,    HEX, $ff000080,                                            \

              borderMenu,         NUM, bxRaised,                                             \
              menuIconMargin,     NUM, 4,                                                    \
              menuSeparatorHeight,NUM, 10,                                                   \
              menuMinTextDist,    NUM, 32,                                                   \
              menuSubIcon,        PNG, "%lib%/gui/images/menu/submenu.png",                  \
              menuSubIconSel,     PNG, "%lib%/gui/images/menu/submenusel.png",               \
              menuSubIconGray,    PNG, "%lib%/gui/images/menu/submenugray.png",              \







>
>
>
>
>
>
>
>
>
>







 







>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
               clBtnTxt,        HEX, <$ff000000, $ff000000, $ff000000, $ff606060>,           \
               btnBorder,       NUM, <bxRaised, bxRaised, bxSunken, bxRaised or bxDisabled>,               \
               btnPressedOfsX,  NUM, 1,                                      \
               btnPressedOfsY,  NUM, 1,                                      \
               btnMarginX,      NUM, 8,                                      \
               btnMarginY,      NUM, 8,                                      \
\
\ ; Toolbar buttons colors and styles
               clToolBtnBk,     HEX, <$ffd4d0c8, $ffe0e0e0, $ffa0a0a0, $80d4d0c8>,              \
               clToolBtnTxt,    HEX, <$ff000000, $ff000000, $ff000000, $ff606060>,              \
               tbBorder,        NUM, <bxNone, bxRaised, bxSunken, bxNone or bxDisabled>,        \
               tbBorderWidth,   NUM, 1,                                      \
               tbPressedOfsX,   NUM, 1,                                      \
               tbPressedOfsY,   NUM, 1,                                      \
               tbSeparatorType,  HEX, bxSunken,                              \
               tbSeparatorWidth, NUM, 10,                                    \
\
\ ; TEdit colors and styles.
\
               clEditBk,          HEX, $ffffffff,                            \
               clEditBkFocused,   HEX, $ffffffff,                            \
               clEditTxt,         HEX, $ff000000,                            \
               clEditSel,         HEX, $600a246c,                            \
               clEditSelTxt,      HEX, $ffffffff,                            \
................................................................................
\
\ ; TMenu colors and styles
\
              clMenuBack,         HEX, $ffd4d0c8,                                            \
              clMenuText,         HEX, $ff000000,                                            \
              clMenuTextGray,     HEX, $80000000,                                            \
              clMenuSelection,    HEX, $ff000080,                                            \
              clMenuSelIcon,      HEX, $ffadaabb,                                            \
              borderMenu,         NUM, bxRaised,                                             \
              menuIconMargin,     NUM, 4,                                                    \
              menuSeparatorHeight,NUM, 10,                                                   \
              menuMinTextDist,    NUM, 32,                                                   \
              menuSubIcon,        PNG, "%lib%/gui/images/menu/submenu.png",                  \
              menuSubIconSel,     PNG, "%lib%/gui/images/menu/submenusel.png",               \
              menuSubIconGray,    PNG, "%lib%/gui/images/menu/submenugray.png",              \

Changes to freshlib/system/Linux/files.asm.

12
13
14
15
16
17
18

19
20
21
22
23
24
25
...
651
652
653
654
655
656
657
































;
;  Notes:
;_________________________________________________________________________________________

uses libc

DIR_SLASH equ '/'


fsFromBegin     = 0
fsFromEnd       = 2
fsFromCurrent   = 1


faReadOnly   = O_RDONLY
................................................................................
        int     $80

        mov     [esp+4*regEAX], eax
        bt      eax, 31         ; if negative - error
        popad
        return
endp







































>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
;
;  Notes:
;_________________________________________________________________________________________

uses libc

DIR_SLASH equ '/'
DIR_SEP_PAIR equ '/\' ; for use with StrNormalizePath and StrNormalizePath2

fsFromBegin     = 0
fsFromEnd       = 2
fsFromCurrent   = 1


faReadOnly   = O_RDONLY
................................................................................
        int     $80

        mov     [esp+4*regEAX], eax
        bt      eax, 31         ; if negative - error
        popad
        return
endp





body IsRelativePath     ;, .hPath
begin
        push    eax
        stdcall StrLen, [.hPath]
        test    eax, eax
        jz      .relative

        stdcall StrPtr, [.hPath]
        cmp     byte [eax], DIR_SLASH
        clc
        je      .finish

.relative:
        stc     ; relative!

.finish:
        pop     eax
        return
endp



body GetCurrentPrefix
begin
        stdcall StrNew
        return
endp

Changes to freshlib/system/Win32/files.asm.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
573
574
575
576
577
578
579






























































;
;  Notes:
;_________________________________________________________________________________________

uses kernel32

DIR_SLASH equ '\'


fsFromBegin     = FILE_BEGIN
fsFromEnd       = FILE_END
fsFromCurrent   = FILE_CURRENT

faReadOnly   = GENERIC_READ
faWriteOnly  = GENERIC_WRITE
................................................................................

.notexists:
        stc
        popad
        return
endp






































































>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
;
;  Notes:
;_________________________________________________________________________________________

uses kernel32

DIR_SLASH equ '\'
DIR_SEP_PAIR equ '\/'   ; for use with StrNormalizePath and StrNormalizePath2

fsFromBegin     = FILE_BEGIN
fsFromEnd       = FILE_END
fsFromCurrent   = FILE_CURRENT

faReadOnly   = GENERIC_READ
faWriteOnly  = GENERIC_WRITE
................................................................................

.notexists:
        stc
        popad
        return
endp





body IsRelativePath     ;, .hPath
begin
        push    eax
        stdcall StrLen, [.hPath]
        cmp     eax, 3
        jb      .relative

        stdcall StrPtr, [.hPath]
        cmp     byte [eax], DIR_SLASH
        jne      .drive
        cmp      byte [eax+1], DIR_SLASH
        jmp      .absolute

.drive:
        cmp     byte [eax], 'A'
        jb      .relative
        cmp     byte [eax], 'Z'
        jbe     .maybe_drive

        cmp     byte [eax], 'a'
        jb      .relative
        cmp     byte [eax], 'Z'
        ja      .relative

.maybe_drive:
        cmp     byte [eax+1], ':'
        jne     .relative

        cmp     byte [eax+2], DIR_SLASH
        jne     .relative

.absolute:
        clc
        pop     eax
        return

.relative:
        cmp     byte [eax], DIR_SLASH
        stc
        pop     eax
        return
endp




body GetCurrentPrefix
begin
        stdcall GetCurrentDir
        push    eax

        stdcall StrPtr, eax
        and     dword [eax+2], 0
        mov     [eax+string.len], 2

        pop     eax
        return
endp

Changes to freshlib/system/files.asm.

26
27
28
29
30
31
32






















33
34
35
36
37
38
39
__std_handle_out:
  var STDOUT = 1
__std_handle_err:
  var STDERR = 2
endg

























interface FileOpenAccess, .filename, .access

interface FileClose, .handle

; returns 32bit file size in eax
interface FileSize, .handle







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
__std_handle_out:
  var STDOUT = 1
__std_handle_err:
  var STDERR = 2
endg


;----------------------------------------------------
; Returns:
;   CF = 1 if the path is relative.
;
;   CF = 0 if the path is absolute.
;          In this case ZF=0 indicates that the
;          path is relative towards the current root
;          prefix (drive letter in Windows)
;          ZF=1 indicates that the path is fully absolute.
;
;   CF = 1 - the path is fully relative.
;   CF = 0, ZF = 1 - the path is fully absolute.
;   CF = 0, ZF = 0 - the path is absolute, but needs
;                    the current root prefix ahead.
;
; This procedure is OS dependent, because the
; paths are different in the different OSes.
;----------------------------------------------------
interface IsRelativePath, .hPath

; Returns the current root prefix if any. Can be empty string.
interface GetCurrentPrefix

interface FileOpenAccess, .filename, .access

interface FileClose, .handle

; returns 32bit file size in eax
interface FileSize, .handle

Changes to freshlib/test_code/TestStrLib.asm.

46
47
48
49
50
51
52
53




















54
55





















56
57
58
59
60
61
62
...
374
375
376
377
378
379
380










endg

TestPosHeap text  'saasoidhjaasdfsijoa;aijdfasi;ojaryiaejnkjfvnarfui;adnv'
TestPosNeedle text 'b'






















start:
        InitializeAll






















; Test StrPos procedure


        stdcall StrDupMem, TestPosHeap
        mov     esi, eax

................................................................................
        repne scasb
        lea     eax, [edi-1]
        sub     eax, [.ptrString]

        pop     ecx edi
        return
endp
















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429


endg

TestPosHeap text  'saasoidhjaasdfsijoa;aijdfasi;ojaryiaejnkjfvnarfui;adnv'
TestPosNeedle text 'b'


proc TestNP, .pString
begin
        stdcall StrDupMem, [.pString]
        mov     ebx, eax

        stdcall FileWriteString, [STDOUT], txt 'From: '
        stdcall FileWriteString, [STDOUT], ebx
        stdcall FileWriteString, [STDOUT], <txt 13, 10>

;        stdcall StrNormalizePath2, ebx, "/\"

        stdcall FileWriteString, [STDOUT], txt '  To: '
        stdcall FileWriteString, [STDOUT], ebx
        stdcall FileWriteString, [STDOUT], <txt 13, 10, 13, 10>

        stdcall StrDel ; from the stack.
        return
endp


start:
        InitializeAll


; Test StrNormalizePath

        stdcall TestNP, "../../work./asm.work/test.asm"
        stdcall TestNP, "/usr/./lib/./../../work./asm.work/test.asm"
        stdcall TestNP, "/usr/./././lib/test.asm"
        stdcall TestNP, "/usr/../lib/test.asm"
        stdcall TestNP, "./usr/../lib/test.asm"
        stdcall TestNP, "usr/../lib/test.asm"
        stdcall TestNP, "usr/././lib/../test.asm"
        stdcall TestNP, "././lib/../test.asm"
        stdcall TestNP, "./././lib/test.asm"
        stdcall TestNP, "/usr/lib/../../../../work./asm.work/test.asm"
        stdcall TestNP, "/usr/lib\../..\../..\work./asm.work\test.asm"


        stdcall FileReadLine, [STDIN]
        jmp     .finish



; Test StrPos procedure


        stdcall StrDupMem, TestPosHeap
        mov     esi, eax

................................................................................
        repne scasb
        lea     eax, [edi-1]
        sub     eax, [.ptrString]

        pop     ecx edi
        return
endp








Changes to freshlib/test_code/TestStrLib.fpr.

cannot compute difference between binary files

Changes to freshlib/test_code0/TestMenu.asm.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
158
159
160
161
162
163
164
165
166
167
168




169
170
171
172
173
174
175
...
248
249
250
251
252
253
254









255
256
257
258
259
260
261
;  Notes:
;_________________________________________________________________________________________

include "%lib%/freshlib.inc"

@BinaryType GUI, compact

options.DebugMode = 0
  options.DebugMode.NoTimers = 0
  options.DebugMode.XSync = 0
  options.DebugMode.XErrors =0

options.ShowSizes = 1
options.SkipZeroSizes = 1

................................................................................

iglobal
TemplateMainForm:
        ObjTemplate  tfParent or tfEnd, TForm, frmMain, \
                     x = 200,          \
                     y = 200,          \
                     width = 320,    \
                     height = 240,   \
                     OnCreate = FormOnCreate,    \
                     OnClose = MainFormOnClose,  \
                     OnDestroy = FormOnDestroy,  \
                     Caption = 'Popup menu test'

          ObjTemplate tfChild, TEdit, editTest,                 \
                     x = 10, y = 200, width = 300, height = 24, \
                     Text = "This is test TEdit control",       \
                     Visible = TRUE

          ObjTemplate tfParent, TActionList, ActionList1,    \
                     ImgIcons = imgMenuList

             ObjTemplate tfChild, TAction, actCheck,                \
                         Caption = "Check it", HintText = "Action that can be checked and unchecked.",         \
                         OnExecute = ActionOnCheck,                                                                \
                         IconIndex = 9

................................................................................
                     Visible = TRUE

          ObjTemplate tfChild, TCheckbox, cbEnableDisable2,     \
                     x = 146, y = 130, width = 100, height = 24,         \
                     Action = [actCheck],                                \
                     Visible = TRUE

          ObjTemplate tfChild or tfEnd, TCheckbox, cbEnableDisable,     \
                     x = 146, y = 104, width = 100, height = 24,         \
                     Action = [actCheck],                                \
                     Visible = TRUE






TemplateMainMenu:
      ObjTemplate  tfEnd, TMenu, mainMenu,              \
        Visible = FALSE

TemplateSubMenu:
................................................................................

        exec    [subMenu], TMenu:AddItem, mitAction, [actClean]
        exec    [subMenu], TMenu:AddItem, mitSeparator, 0
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/source/Fresh.fpr"
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/source/Fresh.asm"
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/freshlib/freshlib.inc"










        stdcall Run

        FinalizeAll
        stdcall TerminateAll, 0










|







 







|










|







 







|



>
>
>
>







 







>
>
>
>
>
>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
...
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
;  Notes:
;_________________________________________________________________________________________

include "%lib%/freshlib.inc"

@BinaryType GUI, compact

options.DebugMode = 1
  options.DebugMode.NoTimers = 0
  options.DebugMode.XSync = 0
  options.DebugMode.XErrors =0

options.ShowSizes = 1
options.SkipZeroSizes = 1

................................................................................

iglobal
TemplateMainForm:
        ObjTemplate  tfParent or tfEnd, TForm, frmMain, \
                     x = 200,          \
                     y = 200,          \
                     width = 320,    \
                     height = 260,   \
                     OnCreate = FormOnCreate,    \
                     OnClose = MainFormOnClose,  \
                     OnDestroy = FormOnDestroy,  \
                     Caption = 'Popup menu test'

          ObjTemplate tfChild, TEdit, editTest,                 \
                     x = 10, y = 200, width = 300, height = 24, \
                     Text = "This is test TEdit control",       \
                     Visible = TRUE

          ObjTemplate tfParent or tfChild, TActionList, ActionList1,    \
                     ImgIcons = imgMenuList

             ObjTemplate tfChild, TAction, actCheck,                \
                         Caption = "Check it", HintText = "Action that can be checked and unchecked.",         \
                         OnExecute = ActionOnCheck,                                                                \
                         IconIndex = 9

................................................................................
                     Visible = TRUE

          ObjTemplate tfChild, TCheckbox, cbEnableDisable2,     \
                     x = 146, y = 130, width = 100, height = 24,         \
                     Action = [actCheck],                                \
                     Visible = TRUE

          ObjTemplate tfChild, TCheckbox, cbEnableDisable,     \
                     x = 146, y = 104, width = 100, height = 24,         \
                     Action = [actCheck],                                \
                     Visible = TRUE

          ObjTemplate tfChild or tfEnd, TToolbar, tbTest,        \
                     x = 0, y = 236, width = 320, height = 24,  \
                     Visible = TRUE


TemplateMainMenu:
      ObjTemplate  tfEnd, TMenu, mainMenu,              \
        Visible = FALSE

TemplateSubMenu:
................................................................................

        exec    [subMenu], TMenu:AddItem, mitAction, [actClean]
        exec    [subMenu], TMenu:AddItem, mitSeparator, 0
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/source/Fresh.fpr"
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/source/Fresh.asm"
        exec    [subMenu], TMenu:AddItem, mitString, "/home/johnfound/Fresh/freshlib/freshlib.inc"


        exec    [tbTest], TToolbar:AddButton, [actNew]
        exec    [tbTest], TToolbar:AddButton, [actOpen]
        exec    [tbTest], TToolbar:AddButton, [actSave]
        exec    [tbTest], TToolbar:AddButton, [actSaveAll]
        exec    [tbTest], TToolbar:AddButton, 0
        exec    [tbTest], TToolbar:AddButton, [actClose]
        exec    [tbTest], TToolbar:AddButton, [actCloseAll]

        stdcall Run

        FinalizeAll
        stdcall TerminateAll, 0



Changes to freshlib/test_code0/TestMenu.fpr.

cannot compute difference between binary files

Changes to freshlib/test_code0/theme_flat.cfg.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15








16
17
18
19
20
21
22
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55


clBorderNeutral = $FF1ABC9C
clBorderLight = $FF1ABC9C
clBorderDark = $FF1ABC9C
clBorderNeutralGray = $FF606060
clBorderLightGray = $FF606060
clBorderDarkGray = $FF606060
clBorderFocused = $FFE74C3C
boxBorderWidth = 2
clBtnBk = $FF1ABC9C, $FF48C9B0, $FF16A085, $807B7B7B
clBtnTxt = $FFFFFFFF, $FFFFFFFF, $FFBDC3C7, $80FFFFFF
btnBorder = 0, 0, 0, 0
btnPressedOfsX = 0
btnPressedOfsY = 0
btnMarginX = 8
btnMarginY = 8








clEditBk = $FFECF0F1
clEditBkFocused = $FFECF0F1
clEditTxt = $FF000000
clEditSel = $602980B9
clEditSelTxt = $FFFFFFFF
editBorder = 3
editBorderFocused = 3
................................................................................
progressBorder = 3
clScrollBk = $3FBDC3C7, $A0BDC3C7
clScrollSlider = $7F7F8C8D, $FF1ABC9C
clScrollSliderOvf = $3FF39C12, $FFF39C12
borderScroll = 0
scrollWidth = 12
minSliderHeight = 24
clLabelBk = $0
clLabelTxt = $FF000000
clTreeViewBack = $FFECF0F1
clTreeViewText = $FF000000
clTreeSelected = $FF2980B9
clTreeSelectedTxt = $FFFFFFFF
clTreeFocused = $FFD35400
clTreeFocusedTxt = $FFFFFFFF
tvBorder = 3
tvIcons = 297:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAMAAACecocUAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEJQTFRFAAAAgICAkra2n5+fmaOjkqiolqamlaWllqWllKWnlaWllaSmlqWllaWllqWllaWmlaWmlaWmlaWmlaWmlaWmlaWml3PoaAAAABV0Uk5TAAIHCBkjLkFmbm9zd4Ciu8vM4uj9nlc1ogAAADhJREFUCJlj4OJhZoABXlEhDkY4W1RUkB3BFhXlZ0OwRUX4WOBsUVFhViziCPUC7Jjmc3IzwawFAEAMBLa48vXWAAAAAElFTkSuQmCC, 333:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADKSURBVBiVhY+7TgJhFIS/+d3QmWDhE/gQhlfgAbb46U00aENMoKCgs5ZIRey49FpbmFhZm9iQ0FFaC2yGQjFcVna6Oec7l1FvMLgATijWV2LrGHFXREo0wmkp6QomBex0WS4/hDRN5xbtQ6Rx66Za/RaAbfWGozegkoO+X8V4Lsnh5x/ZuJm3NUhNSQYI62K9VnsVet5hny5jfPkb3Oxk8i2wXFuL1taVTXMd46fR42+qfj3Gj39hgKNs0QZmibNOXoY93Y/HZ3n1FeLFO3+97VjQAAAAAElFTkSuQmCC
clMenuBack = $FFECF0F1
clMenuText = $FF000000
clMenuTextGray = $90000000
clMenuSelection = $FF2980B9

borderMenu = 3
menuIconMargin = 4
menuSeparatorHeight = 12
menuMinTextDist = 32
menuSubIcon = 206:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABLSURBVBiVjc+xDYBADATBeSQCIgqgYzJaoARSInqgH5MQvQ6JzezVyT7YMAgUdoxJFA5MSRQuzEkUbiztHXrOz8SvG/Gr2GNF65cP8X4dCPkfyx8AAAAASUVORK5CYII-
menuSubIconSel = 207:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABMSURBVBiVjc+xDYAwEEPRCxIFFQOwcTpWyAi0VOzAPi8FXTgk3H5Z3w7smGKMJw1zBuDAkgG4sGYAbmwFXuKI87Pxy5GuSn9UlNHeAYWml41HdWNxAAAAAElFTkSuQmCC
menuSubIconGray = 280:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACVSURBVBiVY5i6dOnEhoYGJgY0wMTAwJgnpqq6YObMmaxoEgwM/xkYY//w8K7tW7WKE0UCCnzZf//ZMXPVKn4GBgYGxqlLl/1HM/4q0x8WdwxLGRgYtP+x/JmPTeIq0x+WRHSJQyysLNaZ8WFPkSU2/2Rl8UgPC/sIdxUjw//FLF8+BxeFhX2HK5u2ZFnX////GdEtAgDKqy21io/rDwAAAABJRU5ErkJggg--
>
>

|
|

|
|




|




>
>
>
>
>
>
>
>







 







|













>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clTextCaret = $FFE74C3C
caretTimes = 250, 250
clBorderNeutral = $FF1ABC9C
clBorderLight = $FF31E2BF
clBorderDark = $FF138670
clBorderNeutralGray = $FF606060
clBorderLightGray = $FF808080
clBorderDarkGray = $FF404040
clBorderFocused = $FFE74C3C
boxBorderWidth = 2
clBtnBk = $FF1ABC9C, $FF48C9B0, $FF16A085, $807B7B7B
clBtnTxt = $FFFFFFFF, $FFFFFFFF, $FFBDC3C7, $80FFFFFF
btnBorder = 0, 0, 0, 1073741824
btnPressedOfsX = 0
btnPressedOfsY = 0
btnMarginX = 8
btnMarginY = 8
clToolBtnBk = $FFECF0F1, $FFC9DCE7, $FFC9DCE7, $FFECF0F1
clToolBtnTxt = $FF000000, $FF000000, $FF000000, $80000000
tbBorder = 0, 0, 0, 1073741824
tbBorderWidth = 1
tbPressedOfsX = 0
tbPressedOfsY = 2
tbSeparatorType = $40000003
tbSeparatorWidth = 10
clEditBk = $FFECF0F1
clEditBkFocused = $FFECF0F1
clEditTxt = $FF000000
clEditSel = $602980B9
clEditSelTxt = $FFFFFFFF
editBorder = 3
editBorderFocused = 3
................................................................................
progressBorder = 3
clScrollBk = $3FBDC3C7, $A0BDC3C7
clScrollSlider = $7F7F8C8D, $FF1ABC9C
clScrollSliderOvf = $3FF39C12, $FFF39C12
borderScroll = 0
scrollWidth = 12
minSliderHeight = 24
clLabelBk = $FFECF0F1
clLabelTxt = $FF000000
clTreeViewBack = $FFECF0F1
clTreeViewText = $FF000000
clTreeSelected = $FF2980B9
clTreeSelectedTxt = $FFFFFFFF
clTreeFocused = $FFD35400
clTreeFocusedTxt = $FFFFFFFF
tvBorder = 3
tvIcons = 297:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAMAAACecocUAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAEJQTFRFAAAAgICAkra2n5+fmaOjkqiolqamlaWllqWllKWnlaWllaSmlqWllaWllqWllaWmlaWmlaWmlaWmlaWmlaWmlaWml3PoaAAAABV0Uk5TAAIHCBkjLkFmbm9zd4Ciu8vM4uj9nlc1ogAAADhJREFUCJlj4OJhZoABXlEhDkY4W1RUkB3BFhXlZ0OwRUX4WOBsUVFhViziCPUC7Jjmc3IzwawFAEAMBLa48vXWAAAAAElFTkSuQmCC, 333:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADKSURBVBiVhY+7TgJhFIS/+d3QmWDhE/gQhlfgAbb46U00aENMoKCgs5ZIRey49FpbmFhZm9iQ0FFaC2yGQjFcVna6Oec7l1FvMLgATijWV2LrGHFXREo0wmkp6QomBex0WS4/hDRN5xbtQ6Rx66Za/RaAbfWGozegkoO+X8V4Lsnh5x/ZuJm3NUhNSQYI62K9VnsVet5hny5jfPkb3Oxk8i2wXFuL1taVTXMd46fR42+qfj3Gj39hgKNs0QZmibNOXoY93Y/HZ3n1FeLFO3+97VjQAAAAAElFTkSuQmCC
clMenuBack = $FFECF0F1
clMenuText = $FF000000
clMenuTextGray = $90000000
clMenuSelection = $FF2980B9
clMenuSelIcon = $FFC9DCE7
borderMenu = 3
menuIconMargin = 4
menuSeparatorHeight = 12
menuMinTextDist = 32
menuSubIcon = 206:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABLSURBVBiVjc+xDYBADATBeSQCIgqgYzJaoARSInqgH5MQvQ6JzezVyT7YMAgUdoxJFA5MSRQuzEkUbiztHXrOz8SvG/Gr2GNF65cP8X4dCPkfyx8AAAAASUVORK5CYII-
menuSubIconSel = 207:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABMSURBVBiVjc+xDYAwEEPRCxIFFQOwcTpWyAi0VOzAPi8FXTgk3H5Z3w7smGKMJw1zBuDAkgG4sGYAbmwFXuKI87Pxy5GuSn9UlNHeAYWml41HdWNxAAAAAElFTkSuQmCC
menuSubIconGray = 280:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACVSURBVBiVY5i6dOnEhoYGJgY0wMTAwJgnpqq6YObMmaxoEgwM/xkYY//w8K7tW7WKE0UCCnzZf//ZMXPVKn4GBgYGxqlLl/1HM/4q0x8WdwxLGRgYtP+x/JmPTeIq0x+WRHSJQyysLNaZ8WFPkSU2/2Rl8UgPC/sIdxUjw//FLF8+BxeFhX2HK5u2ZFnX////GdEtAgDKqy21io/rDwAAAABJRU5ErkJggg--

Changes to freshlib/test_code0/theme_win.cfg.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15








16
17
18
19
20
21
22
..
42
43
44
45
46
47
48

49
50
51
52
53
54
55


clBorderNeutral = $FFA0A0A0
clBorderLight = $FFFFFFFF
clBorderDark = $FF404040
clBorderNeutralGray = $FF909090
clBorderLightGray = $FFE0E0E0
clBorderDarkGray = $FF808080
clBorderFocused = $FFFF8000
boxBorderWidth = 1
clBtnBk = $FFD4D0C8, $FFE0E0E0, $FFA0A0A0, $80D4D0C8
clBtnTxt = $FF000000, $FF000000, $FF000000, $FF606060
btnBorder = 1, 1, 2
btnPressedOfsX = 1
btnPressedOfsY = 1
btnMarginX = 8
btnMarginY = 8








clEditBk = $FFFFFFFF
clEditBkFocused = $FFFFFFFF
clEditTxt = $FF000000
clEditSel = $600A246C
clEditSelTxt = $FFFFFFFF
editBorder = 2
editBorderFocused = 2
................................................................................
clTreeFocusedTxt = $FFFFFF00
tvBorder = 2
tvIcons = 117:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALAQMAAACTYuVlAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAAB1JREFUCNdjYGBgqD/A4ODA4AJG8TAGUAQozsAAAGXeBi6dny4xAAAAAElFTkSuQmCC, 114:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALAQMAAACTYuVlAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjYGBgqD/A4OAARfEOCDZQnIEBAGTOBh7FK7i2AAAAAElFTkSuQmCC
clMenuBack = $FFD4D0C8
clMenuText = $FF000000
clMenuTextGray = $80000000
clMenuSelection = $FF000080

borderMenu = 1
menuIconMargin = 4
menuSeparatorHeight = 10
menuMinTextDist = 32
menuSubIcon = 206:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABLSURBVBiVjc+xDYBADATBeSQCIgqgYzJaoARSInqgH5MQvQ6JzezVyT7YMAgUdoxJFA5MSRQuzEkUbiztHXrOz8SvG/Gr2GNF65cP8X4dCPkfyx8AAAAASUVORK5CYII-
menuSubIconSel = 207:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABMSURBVBiVjc+xDYAwEEPRCxIFFQOwcTpWyAi0VOzAPi8FXTgk3H5Z3w7smGKMJw1zBuDAkgG4sGYAbmwFXuKI87Pxy5GuSn9UlNHeAYWml41HdWNxAAAAAElFTkSuQmCC
menuSubIconGray = 280:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACVSURBVBiVY5i6dOnEhoYGJgY0wMTAwJgnpqq6YObMmaxoEgwM/xkYY//w8K7tW7WKE0UCCnzZf//ZMXPVKn4GBgYGxqlLl/1HM/4q0x8WdwxLGRgYtP+x/JmPTeIq0x+WRHSJQyysLNaZ8WFPkSU2/2Rl8UgPC/sIdxUjw//FLF8+BxeFhX2HK5u2ZFnX////GdEtAgDKqy21io/rDwAAAABJRU5ErkJggg--
>
>










|




>
>
>
>
>
>
>
>







 







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
clTextCaret = $FFFF0000
caretTimes = 250, 250
clBorderNeutral = $FFA0A0A0
clBorderLight = $FFFFFFFF
clBorderDark = $FF404040
clBorderNeutralGray = $FF909090
clBorderLightGray = $FFE0E0E0
clBorderDarkGray = $FF808080
clBorderFocused = $FFFF8000
boxBorderWidth = 1
clBtnBk = $FFD4D0C8, $FFE0E0E0, $FFA0A0A0, $80D4D0C8
clBtnTxt = $FF000000, $FF000000, $FF000000, $FF606060
btnBorder = 1, 1, 2, 1073741825
btnPressedOfsX = 1
btnPressedOfsY = 1
btnMarginX = 8
btnMarginY = 8
clToolBtnBk = $FFD4D0C8, $FFE0E0E0, $FFA0A0A0, $80D4D0C8
clToolBtnTxt = $FF000000, $FF000000, $FF000000, $FF606060
tbBorder = 0, 1, 2, 1073741824
tbBorderWidth = 1
tbPressedOfsX = 1
tbPressedOfsY = 1
tbSeparatorType = $2
tbSeparatorWidth = 10
clEditBk = $FFFFFFFF
clEditBkFocused = $FFFFFFFF
clEditTxt = $FF000000
clEditSel = $600A246C
clEditSelTxt = $FFFFFFFF
editBorder = 2
editBorderFocused = 2
................................................................................
clTreeFocusedTxt = $FFFFFF00
tvBorder = 2
tvIcons = 117:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALAQMAAACTYuVlAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAAB1JREFUCNdjYGBgqD/A4ODA4AJG8TAGUAQozsAAAGXeBi6dny4xAAAAAElFTkSuQmCC, 114:iVBORw0KGgoAAAANSUhEUgAAAAsAAAALAQMAAACTYuVlAAAABlBMVEUAAAAAAAClZ7nPAAAAAXRSTlMAQObYZgAAABpJREFUCNdjYGBgqD/A4OAARfEOCDZQnIEBAGTOBh7FK7i2AAAAAElFTkSuQmCC
clMenuBack = $FFD4D0C8
clMenuText = $FF000000
clMenuTextGray = $80000000
clMenuSelection = $FF000080
clMenuSelIcon = $FFADAABB
borderMenu = 1
menuIconMargin = 4
menuSeparatorHeight = 10
menuMinTextDist = 32
menuSubIcon = 206:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABLSURBVBiVjc+xDYBADATBeSQCIgqgYzJaoARSInqgH5MQvQ6JzezVyT7YMAgUdoxJFA5MSRQuzEkUbiztHXrOz8SvG/Gr2GNF65cP8X4dCPkfyx8AAAAASUVORK5CYII-
menuSubIconSel = 207:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABMSURBVBiVjc+xDYAwEEPRCxIFFQOwcTpWyAi0VOzAPi8FXTgk3H5Z3w7smGKMJw1zBuDAkgG4sGYAbmwFXuKI87Pxy5GuSn9UlNHeAYWml41HdWNxAAAAAElFTkSuQmCC
menuSubIconGray = 280:iVBORw0KGgoAAAANSUhEUgAAAAYAAAALCAYAAABcUvyWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAACVSURBVBiVY5i6dOnEhoYGJgY0wMTAwJgnpqq6YObMmaxoEgwM/xkYY//w8K7tW7WKE0UCCnzZf//ZMXPVKn4GBgYGxqlLl/1HM/4q0x8WdwxLGRgYtP+x/JmPTeIq0x+WRHSJQyysLNaZ8WFPkSU2/2Rl8UgPC/sIdxUjw//FLF8+BxeFhX2HK5u2ZFnX////GdEtAgDKqy21io/rDwAAAABJRU5ErkJggg--