Fresh IDE . Check-in [c59d12fb90]
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:Different implementation of show/hide component palette not using IsWindowVisible.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c59d12fb90dcfb9321694592b4cf697267c9b80d
User & Date: johnfound 2017-09-09 13:57:33
Context
2017-09-22
16:00
Added new instruction set reference. Not full, but is pretty helpful because contains the flags affected and explain the instructions in details. check-in: 59c17aeab1 user: johnfound tags: trunk
2017-09-09
13:57
Different implementation of show/hide component palette not using IsWindowVisible. check-in: c59d12fb90 user: johnfound tags: trunk
2017-08-23
19:59
FlatAssembler compiler has been updated to v1.71.64 check-in: 89feab28c4 user: johnfound tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to include/libs/SplitGrid2.asm.

734
735
736
737
738
739
740





























































741
742
743
744
745
746
747

        and     edx, eax        ; the OR mask.

        and     [esi+TSplitRect.type], ecx
        or      [esi+TSplitRect.type], edx ; set only one.

        stdcall RealignGrid, [.hwnd], esi, esi   ; realign on its own rectangle.





























































        clc
        popad
        return

.error:
        stc
        popad







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







734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
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

        and     edx, eax        ; the OR mask.

        and     [esi+TSplitRect.type], ecx
        or      [esi+TSplitRect.type], edx ; set only one.

        stdcall RealignGrid, [.hwnd], esi, esi   ; realign on its own rectangle.
        clc
        popad
        return

.error:
        stc
        popad
        return
endp


proc GetCellHidden, .hwnd, .cell
begin
        pushad

        invoke  GetPropW, [.hwnd], [propSplitGrid]
        test    eax, eax
        jz      .error

        lea     esi, [eax+TArray.array]
        mov     edi, esi

        mov     eax, [.cell]
        imul    eax, sizeof.TSplitRect
        add     esi, eax
        xor     ecx, ecx

; first search for the split element of this cell

.loop:
        sub     esi, sizeof.TSplitRect
        cmp     esi, edi
        jb      .error

        bt      [esi+TSplitRect.type], 7        ; stNone
        sbb     edx, edx                        ; -1 if the element is a cell and 0 if split
        lea     edx, [2*edx+1]                  ; -1 if the element is a cell and +1 if split

        add     ecx, edx
        jl      .loop

; here ecx =  0 if the cell is the second cell
;      ecx = +1 if the cell is the first cell

        test    [esi+TSplitRect.type], stOriginBR
        jz      @f
        xor     ecx, 1          ; reverse it if the split is stOriginBR
@@:

        add     ecx, 12         ; stMaxHidden = 2^12; stHidden = 2^13
        xor     edx, edx
        inc     edx
        shl     edx, cl         ; edx = stHidden or stMaxHidden depending on the cell that has to be hidden or shown.
        mov     ecx, edx
        not     ecx             ; AND mask.

        test    [esi+TSplitRect.type], edx
        setnz   al
        movzx   eax, al
        mov     [esp+4*regEAX], eax

        clc
        popad
        return

.error:
        stc
        popad

Changes to source/ActionEvents.asm.

676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707


708

709
710
711
712
713
714

715
716
717
718
719
720
721
....
1904
1905
1906
1907
1908
1909
1910

1911
1912
1913
1914
1915
1916
1917
        stdcall SetCellHidden, [hMainForm], 5, eax

        popad
        return
endp


;proc OnViewSourceEditor, .wparam, .lparam
;begin
;        invoke  IsWindowVisible, [hEditorsHost]
;        test    eax, eax
;        jnz     .setfocus
;
;        mov     ebx, SW_SHOWNORMAL
;        mov     eax, TRUE
;        stdcall ActionSetCheck, [.wparam], eax
;        invoke  ShowWindow, [hEditorsHost], ebx
;        return
;
;.setfocus:
;        stdcall ProcessMessages
;        invoke  SetActiveWindow, [hEditorsHost]
;        return
;endp


proc OnViewPalette, .wparam, .lparam
begin
        invoke  IsWindowVisible, [hToolPalette]
        test    eax, eax
        setnz   bl
        movzx   ebx, bl         ; SW_SHOWNORMAL = 1 and SW_HIDE = 0 !!!




        xor     ebx, SW_SHOWNORMAL

        stdcall ActionSetCheck, [.wparam], ebx
        invoke  ShowWindow, [hToolPalette], ebx
        stdcall SetCellHidden, [hMainForm], MainLayout.cellPalette, ebx


        return
endp



proc OnViewLister, .wparam, .lparam
begin
................................................................................
        lea     edx,[.sinfo]
        invoke  CreateProcessW, NULL, eax, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, edx, ecx  ; remaining from the stack
        stdcall FreeMem ; from the stack

        test    eax,eax
        jnz     .ok


        stdcall LastError

.ok:
        invoke  CloseHandle,[.pinfo.hThread]
        invoke  CloseHandle,[.pinfo.hProcess]
        stdcall StrDel, [.term]








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


<
<
<
<
>
>

>
|





>







 







>







676
677
678
679
680
681
682





683













684
685




686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
....
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
        stdcall SetCellHidden, [hMainForm], 5, eax

        popad
        return
endp





















proc OnViewPalette, .wparam, .lparam
begin




        stdcall GetCellHidden, [hMainForm], MainLayout.cellPalette
        jc      .finish

        mov     ebx, eax        ; ebx = 1 if the palette is hidden and 0 if visible.
                                ; SW_SHOWNORMAL = 1 and SW_HIDE = 0 !!!

        stdcall ActionSetCheck, [.wparam], ebx
        invoke  ShowWindow, [hToolPalette], ebx
        stdcall SetCellHidden, [hMainForm], MainLayout.cellPalette, ebx

.finish:
        return
endp



proc OnViewLister, .wparam, .lparam
begin
................................................................................
        lea     edx,[.sinfo]
        invoke  CreateProcessW, NULL, eax, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, edx, ecx  ; remaining from the stack
        stdcall FreeMem ; from the stack

        test    eax,eax
        jnz     .ok

        int3
        stdcall LastError

.ok:
        invoke  CloseHandle,[.pinfo.hThread]
        invoke  CloseHandle,[.pinfo.hProcess]
        stdcall StrDel, [.term]

Changes to source/Fresh.asm.

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
include 'resourceid.inc'
include 'projmanager.inc'
include 'Controls.inc'
include 'editorhost.inc'
include 'msgwindow.inc'
include 'propgrid.inc'
include 'MainWindow.inc'
;include 'fasm/VERSION.INC'
include 'xref.inc'
include 'LabelsList.inc'
include 'debug.inc'
include 'debugger.inc'
include 'dbgserver.inc'
include 'propeditor.inc'
include 'filemanager.inc'







<







65
66
67
68
69
70
71

72
73
74
75
76
77
78
include 'resourceid.inc'
include 'projmanager.inc'
include 'Controls.inc'
include 'editorhost.inc'
include 'msgwindow.inc'
include 'propgrid.inc'
include 'MainWindow.inc'

include 'xref.inc'
include 'LabelsList.inc'
include 'debug.inc'
include 'debugger.inc'
include 'dbgserver.inc'
include 'propeditor.inc'
include 'filemanager.inc'

Changes to source/MainWindow.asm.

82
83
84
85
86
87
88
89
90
91

92
93
94
95
96
97
98
...
191
192
193
194
195
196
197
198

199
200
201
202
203
204
205
        stdcall OnReloadVCL, 0, [hMainForm]

        stdcall CfgGetInt, [hCfgFileName], cLayoutSection, cShowPaletteKey, 1
        test    eax, eax
        setnz   al
        movzx   eax, al

        push    eax eax
        invoke  ShowWindow, [hToolPalette], eax
        stdcall ActionSetCheck, actViewPalette ; from the stack

        stdcall SetCellHidden, [hMainForm], MainLayout.cellPalette ; from the stack

        stdcall CfgGetInt, [hCfgFileName], cLayoutSection, cShowPropertiesKey, 1
        test    eax, eax
        setnz   al
        movzx   eax, al

................................................................................
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowT, [.wp.rcNormalPosition.top]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowR, [.wp.rcNormalPosition.right]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowB, [.wp.rcNormalPosition.bottom]


; Save the visual layout

        invoke  IsWindowVisible, [hToolPalette]

        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cShowPaletteKey, eax

        invoke  IsWindowVisible, [hPropEditor]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cShowPropertiesKey, eax

; and quit








|
<

>







 







|
>







82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
98
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
        stdcall OnReloadVCL, 0, [hMainForm]

        stdcall CfgGetInt, [hCfgFileName], cLayoutSection, cShowPaletteKey, 1
        test    eax, eax
        setnz   al
        movzx   eax, al

        push    eax eax eax

        stdcall ActionSetCheck, actViewPalette ; from the stack
        invoke  ShowWindow, [hToolPalette] ; from the stack
        stdcall SetCellHidden, [hMainForm], MainLayout.cellPalette ; from the stack

        stdcall CfgGetInt, [hCfgFileName], cLayoutSection, cShowPropertiesKey, 1
        test    eax, eax
        setnz   al
        movzx   eax, al

................................................................................
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowT, [.wp.rcNormalPosition.top]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowR, [.wp.rcNormalPosition.right]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cMainWindowB, [.wp.rcNormalPosition.bottom]


; Save the visual layout

        stdcall GetCellHidden, [hMainForm], MainLayout.cellPalette
        xor     eax, 1
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cShowPaletteKey, eax

        invoke  IsWindowVisible, [hPropEditor]
        stdcall CfgSetInt, [hCfgFileName], cLayoutSection, cShowPropertiesKey, eax

; and quit