Fresh IDE . Check-in [3b83e10d0c]
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:Introduced new macro "rstruct" it creates reverve structures - i.e. that have all fields on negative offsets - as string structure for example. (btw, the string structure was fixed to use rstruct);

The compatibility GUI editor macroses has been fixed to support more FreshLib windows.

Timelines: family | ancestors | descendants | both | FreshLibDev
Files: files | file ages | folders
SHA1: 3b83e10d0ca90bb79bbd28dfb34d94ec1fe4a8bd
User & Date: johnfound 2013-02-06 19:32:21
Context
2013-02-12
10:30
The license of FreshLib has been changed to BSD 2-clause license. Check it in freshlib/License.txt check-in: c6a07aa557 user: johnfound tags: FreshLibDev
2013-02-06
19:32
Introduced new macro "rstruct" it creates reverve structures - i.e. that have all fields on negative offsets - as string structure for example. (btw, the string structure was fixed to use rstruct);

The compatibility GUI editor macroses has been fixed to support more FreshLib windows. check-in: 3b83e10d0c user: johnfound tags: FreshLibDev

2013-01-25
14:03
Changed gui/Win32/windows.asm procedure _RefreshWindow to use RedrawWindow instead of InvalidateRect in order to get better response of the user interface. check-in: 5dc8db060e user: lhmnai0 tags: FreshLibDev
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to freshlib/data/strlib.asm.

14
15
16
17
18
19
20

21
22
23

24
25
26
27
28
29
30
31
32
33
34
35
36
37
;_________________________________________________________________________________________

module "String library"

STR_MINSTRLEN = 127      ; must be N*8-1
STR_SEARCH_ONE_ATEMPT = 100


struc string {
  .capacity dd ?
  .len      dd ?

  label .data byte
}

virtual at -(sizeof.string)
  string string
  sizeof.string = $-string
end virtual


; NumToStr flags
ntsSigned       = $00000
ntsUnsigned     = $10000
ntsFixedWidth   = $20000








>
|


>
|
|
<
<
<
<
<







14
15
16
17
18
19
20
21
22
23
24
25
26
27





28
29
30
31
32
33
34
;_________________________________________________________________________________________

module "String library"

STR_MINSTRLEN = 127      ; must be N*8-1
STR_SEARCH_ONE_ATEMPT = 100


rstruct string
  .capacity dd ?
  .len      dd ?
  .         rb 0
ends








; NumToStr flags
ntsSigned       = $00000
ntsUnsigned     = $10000
ntsFixedWidth   = $20000

Changes to freshlib/gui/OldTemplates.inc.

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
  \}
}



macro Window  name, flags, walign, class, txt, style, styleEx, ID, left, top, width, height, [props] {
common
  local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign

  ..subtype = style and $0f

  ..txtalign = 0

  if ~name eq NONE
     name#.template#:
  end if

  ; flags
       dd    flags      ; the values are the same



  ; class
  if class eq 'TForm'
        dd  CForm
  else
    if class eq 'BUTTON'

      if ..subtype = 0  ; BS_PUSHBUTTON
        dd  CButton
        ..txtalign = dtfAlignCenter or dtfAlignMiddle
      end if

      if ..subtype = 2  ; BS_CHECKBOX
        dd CCheckBox
      end if

      if ..subtype = 4  ; BS_RADIOBUTTON
        dd CRadioButton
      end if

    else

       if class eq 'EDIT'
         if (style and 4)  ;ES_MULTILINE
           dd CFreshEdit                ; it is not good to use CFreshEdit, but we don't have light multiline edit.
         else
           dd CEdit
         end if
       else

         if class eq 'STATIC'
           dd CLabel

           if ..subtype = 1     ; SS_CENTER
             ..txtalign = ..txtalign or dtfAlignCenter
           end if

           if ..subtype = 2     ; SS_RIGHT
             ..txtalign = ..txtalign or dtfAlignCenter
           end if

           if (style and $200) ;SS_CENTERIMAGE
             ..txtalign = ..txtalign or dtfAlignMiddle
           end if

         else
           if class eq 'msctls_progress32'
             dd CProgress
           else
             err 'Invalid class.'
           end if
         end if
       end if

    end if
  end if



  ; name
  if name eq NONE
        dd  ..name
  else
        dd  name
  end if







|












>
>


|




|




|



|






|

|




|















|
<
<






>
>







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
  \}
}



macro Window  name, flags, walign, class, txt, style, styleEx, ID, left, top, width, height, [props] {
common
  local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign, ..class

  ..subtype = style and $0f

  ..txtalign = 0

  if ~name eq NONE
     name#.template#:
  end if

  ; flags
       dd    flags      ; the values are the same

  ..class = CWindow

  ; class
  if class eq 'TForm'
    ..class = CForm
  else
    if class eq 'BUTTON'

      if ..subtype = 0  ; BS_PUSHBUTTON
        ..class = CButton
        ..txtalign = dtfAlignCenter or dtfAlignMiddle
      end if

      if ..subtype = 2  ; BS_CHECKBOX
        ..class = CCheckBox
      end if

      if ..subtype = 4  ; BS_RADIOBUTTON
        ..class = CRadioButton
      end if

    else

       if class eq 'EDIT'
         if (style and 4)  ;ES_MULTILINE
           ..class = CFreshEdit    ; it is not good to use CFreshEdit, but we don't have light multiline edit.
         else
           ..class = CEdit
         end if
       else

         if class eq 'STATIC'
           ..class = CLabel

           if ..subtype = 1     ; SS_CENTER
             ..txtalign = ..txtalign or dtfAlignCenter
           end if

           if ..subtype = 2     ; SS_RIGHT
             ..txtalign = ..txtalign or dtfAlignCenter
           end if

           if (style and $200) ;SS_CENTERIMAGE
             ..txtalign = ..txtalign or dtfAlignMiddle
           end if

         else
           if class eq 'msctls_progress32'
             ..class = CProgress


           end if
         end if
       end if

    end if
  end if

  dd ..class

  ; name
  if name eq NONE
        dd  ..name
  else
        dd  name
  end if
108
109
110
111
112
113
114

115







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

        dd      TWindow.width
        dd      width

        dd      TWindow.height
        dd      height


        dd      TWindow.Caption







        dd      ..caption

  if (style and $10000000) <> 0   ; WS_VISIBLE
        dd      TWindow.Visible
        dd      1
  end if

  if ..txtalign
    if class eq 'BUTTON'
        dd      TButton.TextAlign
    else
        dd      TLabel.TextAlign
    end if
        dd      ..txtalign
  end if
forward







>
|
>
>
>
>
>
>
>








|







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

        dd      TWindow.width
        dd      width

        dd      TWindow.height
        dd      height

        if (..class = CForm)|(..class = CButton)|(..class = CLabel)
          dd      TWindow.Caption
        else
          if ..class = CEdit
            dd TEdit.Text
          else
            dd TFreshEdit.Text
          end if
        end if
        dd      ..caption

  if (style and $10000000) <> 0   ; WS_VISIBLE
        dd      TWindow.Visible
        dd      1
  end if

  if ..txtalign
    if ..class = CButton
        dd      TButton.TextAlign
    else
        dd      TLabel.TextAlign
    end if
        dd      ..txtalign
  end if
forward

Changes to freshlib/macros/_struct.inc.

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
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________

macro struct name {
  macro name@struct \{ name name \}


  macro size@struct \{ sizeof.#name = $ \}
















  struc name \{
}


ends fix } struct_helper


macro struct_helper {
  virtual at 0
    name@struct
    size@struct
  end virtual
  purge name@struc
  purge size@struct
}








|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>








<
|
<
<

<


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
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________

macro struct name {
  macro name@struct \{
    virtual at 0
      name name
      sizeof.#name = $
    end virtual
  \}
  struc name \{
}


macro rstruct name {
  macro name@struct \{
    \local ..start, ..size
    virtual at -..size
      ..start:
      name name
      ..size = $ - ..start
      sizeof.#name = ..size
    end virtual
  \}
  struc name \{
}


ends fix } struct_helper


macro struct_helper {

  name@struct


  purge name@struc

}