Fresh IDE . Check-in [5b08d05798]
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:Semi-transparent caret. Implemented changing insert-mode and the selection type from the keyboard (Insert and Ctrl+Alt+Insert keys.) UpdateCaretPos now updates the caret size as well. Also, vertical caret should be implemented there.
Timelines: family | ancestors | descendants | both | NoCanvasGUI
Files: files | file ages | folders
SHA1:5b08d057989242145add4046782914c749ccc05d
User & Date: johnfound 2017-12-04 15:34:06
Context
2017-12-05
09:56
Added TCaret.visible field for hiding the caret without detaching.

More simple and flexible code for scrolling and rendering in TAsmEdit; Proper processing of the external scroll events. check-in: 2ce9ccfb8f user: johnfound tags: NoCanvasGUI

2017-12-04
15:34
Semi-transparent caret. Implemented changing insert-mode and the selection type from the keyboard (Insert and Ctrl+Alt+Insert keys.) UpdateCaretPos now updates the caret size as well. Also, vertical caret should be implemented there. check-in: 5b08d05798 user: johnfound tags: NoCanvasGUI
13:45
Dirty hack removed. ;) check-in: 3aeaecfe1c user: johnfound tags: NoCanvasGUI
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/gui/TAsmEdit.asm.

548
549
550
551
552
553
554






555
556
557
558
559
560
561
...
639
640
641
642
643
644
645
















646
647
648
649
650
651
652
...
687
688
689
690
691
692
693






694
695
696
697
698
699
700
701
702
703
704
705
706
....
1719
1720
1721
1722
1723
1724
1725

1726
1727
1728
1729
1730
1731
1732
        cmp     eax, keyPgUp
        je      .pgupkey

        cmp     eax, keyPgDnNumpad
        je      .pgdnkey
        cmp     eax, keyPgDown
        je      .pgdnkey







        jmp     .finish

.wordwrap:



................................................................................
        jmp     .endmove

.end_of_text:
        exec    esi, TAsmEdit:CaretTxtEnd, ecx
        jmp     .endmove



















.endmove:

.finish:
        popad
        return
endp
................................................................................

        imul    eax, [esi+TAsmEdit._font_width]
        add     eax, [esi+TAsmEdit._left_margin]

        get     edx, esi, TAsmEdit:PosY
        sub     ecx, edx
        js      .hide_caret







        imul    ecx, [esi+TAsmEdit._font_height]
        add     ecx, [esi+TAsmEdit._font_height]
        sub     ecx, 2

        stdcall CaretChange, eax, ecx, [esi+TAsmEdit._font_width], 2

.finish:
        popad
        return

.hide_caret:
        jmp     .finish
................................................................................
        cmp     eax, [esi+TAsmEdit._options]
        je      .finish

        mov     [esi+TAsmEdit._options], eax
        xor     eax, eax
        mov     [esi+TAsmEdit._img_txt_valid], eax
        exec    esi, TAsmEdit:RectChanged2, eax


.finish:
        popad
        return
endp









>
>
>
>
>
>







 







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







 







>
>
>
>
>
>



|

|







 







>







548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
...
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
...
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
....
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
        cmp     eax, keyPgUp
        je      .pgupkey

        cmp     eax, keyPgDnNumpad
        je      .pgdnkey
        cmp     eax, keyPgDown
        je      .pgdnkey

        cmp     eax, keyInsNumpad
        je      .insertkey
        cmp     eax, keyInsert
        je      .insertkey


        jmp     .finish

.wordwrap:



................................................................................
        jmp     .endmove

.end_of_text:
        exec    esi, TAsmEdit:CaretTxtEnd, ecx
        jmp     .endmove


.insertkey:
        get     eax, esi, TAsmEdit:Options

        mov     edx, aeoOverwriteMode
        mov     ecx, [.kbdState]
        and     ecx, maskCtrl + maskAlt
        cmp     ecx, maskCtrl + maskAlt
        jne     .ins_mask_ok

        mov     edx, aeoBlockSelection

.ins_mask_ok:
        xor     eax, edx
        set     esi, TAsmEdit:Options, eax
        jmp     .endmove


.endmove:

.finish:
        popad
        return
endp
................................................................................

        imul    eax, [esi+TAsmEdit._font_width]
        add     eax, [esi+TAsmEdit._left_margin]

        get     edx, esi, TAsmEdit:PosY
        sub     ecx, edx
        js      .hide_caret

        mov     edx, 2
        test    [esi+TAsmEdit._options], aeoOverwriteMode
        jz      @f
        mov     edx, [esi+TAsmEdit._font_height]
@@:

        imul    ecx, [esi+TAsmEdit._font_height]
        add     ecx, [esi+TAsmEdit._font_height]
        sub     ecx, edx

        stdcall CaretChange, eax, ecx, [esi+TAsmEdit._font_width], edx

.finish:
        popad
        return

.hide_caret:
        jmp     .finish
................................................................................
        cmp     eax, [esi+TAsmEdit._options]
        je      .finish

        mov     [esi+TAsmEdit._options], eax
        xor     eax, eax
        mov     [esi+TAsmEdit._img_txt_valid], eax
        exec    esi, TAsmEdit:RectChanged2, eax
        exec    esi, TAsmEdit:UpdateCaretPos

.finish:
        popad
        return
endp


Changes to freshlib/gui/textcaret.asm.

262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
        jz      .release

        push    ecx edx
        mov     ecx, [Caret.Pos.x]
        mov     edx, [Caret.Pos.y]
        add     ecx, [Caret.xOffs]
        add     edx, [Caret.yOffs]
        stdcall DrawSolidRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]
        pop     edx ecx

.release:
        stdcall MutexRelease, Caret.mxLock
.exit:
        pop     ebx
        return
endp


endmodule









|













262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
        jz      .release

        push    ecx edx
        mov     ecx, [Caret.Pos.x]
        mov     edx, [Caret.Pos.y]
        add     ecx, [Caret.xOffs]
        add     edx, [Caret.yOffs]
        stdcall BlendSolidRect, ebx, ecx, edx, [Caret.Pos.width], [Caret.Pos.height], [GUI.clTextCaret]
        pop     edx ecx

.release:
        stdcall MutexRelease, Caret.mxLock
.exit:
        pop     ebx
        return
endp


endmodule


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

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
clPomegranate = $ffc0392b

iglobal

        NamedArray      GUI,                                           \
\
\ ; Text caret color
                clTextCaret,       HEX, clAlizarin,                    \
                caretTimes,        NUM, <250, 250>,                    \
\ ; Widgets border colors and width
                clBorderNeutral,   HEX, clTurquoise,                   \
                clBorderLight,     HEX, clTurquoise,                   \
                clBorderDark,      HEX, clTurquoise,                   \
                clBorderNeutralGray, HEX, $ff606060,                   \
                clBorderLightGray, HEX, $ff606060,                     \







|







67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
clPomegranate = $ffc0392b

iglobal

        NamedArray      GUI,                                           \
\
\ ; Text caret color
                clTextCaret,       HEX, $d0ff0000,              \       ;(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,                     \