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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to freshlib/data/strlib.asm.

    14     14   ;_________________________________________________________________________________________
    15     15   
    16     16   module "String library"
    17     17   
    18     18   STR_MINSTRLEN = 127      ; must be N*8-1
    19     19   STR_SEARCH_ONE_ATEMPT = 100
    20     20   
    21         -struc string {
           21  +
           22  +rstruct string
    22     23     .capacity dd ?
    23     24     .len      dd ?
    24         -  label .data byte
    25         -}
           25  +  .         rb 0
           26  +ends
    26     27   
    27         -virtual at -(sizeof.string)
    28         -  string string
    29         -  sizeof.string = $-string
    30         -end virtual
    31     28   
    32     29   
    33     30   ; NumToStr flags
    34     31   ntsSigned       = $00000
    35     32   ntsUnsigned     = $10000
    36     33   ntsFixedWidth   = $20000
    37     34   

Changes to freshlib/gui/OldTemplates.inc.

    13     13     \}
    14     14   }
    15     15   
    16     16   
    17     17   
    18     18   macro Window  name, flags, walign, class, txt, style, styleEx, ID, left, top, width, height, [props] {
    19     19   common
    20         -  local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign
           20  +  local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign, ..class
    21     21   
    22     22     ..subtype = style and $0f
    23     23   
    24     24     ..txtalign = 0
    25     25   
    26     26     if ~name eq NONE
    27     27        name#.template#:
    28     28     end if
    29     29   
    30     30     ; flags
    31     31          dd    flags      ; the values are the same
    32     32   
           33  +  ..class = CWindow
           34  +
    33     35     ; class
    34     36     if class eq 'TForm'
    35         -        dd  CForm
           37  +    ..class = CForm
    36     38     else
    37     39       if class eq 'BUTTON'
    38     40   
    39     41         if ..subtype = 0  ; BS_PUSHBUTTON
    40         -        dd  CButton
           42  +        ..class = CButton
    41     43           ..txtalign = dtfAlignCenter or dtfAlignMiddle
    42     44         end if
    43     45   
    44     46         if ..subtype = 2  ; BS_CHECKBOX
    45         -        dd CCheckBox
           47  +        ..class = CCheckBox
    46     48         end if
    47     49   
    48     50         if ..subtype = 4  ; BS_RADIOBUTTON
    49         -        dd CRadioButton
           51  +        ..class = CRadioButton
    50     52         end if
    51     53   
    52     54       else
    53     55   
    54     56          if class eq 'EDIT'
    55     57            if (style and 4)  ;ES_MULTILINE
    56         -           dd CFreshEdit                ; it is not good to use CFreshEdit, but we don't have light multiline edit.
           58  +           ..class = CFreshEdit    ; it is not good to use CFreshEdit, but we don't have light multiline edit.
    57     59            else
    58         -           dd CEdit
           60  +           ..class = CEdit
    59     61            end if
    60     62          else
    61     63   
    62     64            if class eq 'STATIC'
    63         -           dd CLabel
           65  +           ..class = CLabel
    64     66   
    65     67              if ..subtype = 1     ; SS_CENTER
    66     68                ..txtalign = ..txtalign or dtfAlignCenter
    67     69              end if
    68     70   
    69     71              if ..subtype = 2     ; SS_RIGHT
    70     72                ..txtalign = ..txtalign or dtfAlignCenter
................................................................................
    72     74   
    73     75              if (style and $200) ;SS_CENTERIMAGE
    74     76                ..txtalign = ..txtalign or dtfAlignMiddle
    75     77              end if
    76     78   
    77     79            else
    78     80              if class eq 'msctls_progress32'
    79         -             dd CProgress
    80         -           else
    81         -             err 'Invalid class.'
           81  +             ..class = CProgress
    82     82              end if
    83     83            end if
    84     84          end if
    85     85   
    86     86       end if
    87     87     end if
           88  +
           89  +  dd ..class
    88     90   
    89     91     ; name
    90     92     if name eq NONE
    91     93           dd  ..name
    92     94     else
    93     95           dd  name
    94     96     end if
................................................................................
   108    110   
   109    111           dd      TWindow.width
   110    112           dd      width
   111    113   
   112    114           dd      TWindow.height
   113    115           dd      height
   114    116   
   115         -        dd      TWindow.Caption
          117  +        if (..class = CForm)|(..class = CButton)|(..class = CLabel)
          118  +          dd      TWindow.Caption
          119  +        else
          120  +          if ..class = CEdit
          121  +            dd TEdit.Text
          122  +          else
          123  +            dd TFreshEdit.Text
          124  +          end if
          125  +        end if
   116    126           dd      ..caption
   117    127   
   118    128     if (style and $10000000) <> 0   ; WS_VISIBLE
   119    129           dd      TWindow.Visible
   120    130           dd      1
   121    131     end if
   122    132   
   123    133     if ..txtalign
   124         -    if class eq 'BUTTON'
          134  +    if ..class = CButton
   125    135           dd      TButton.TextAlign
   126    136       else
   127    137           dd      TLabel.TextAlign
   128    138       end if
   129    139           dd      ..txtalign
   130    140     end if
   131    141   forward

Changes to freshlib/macros/_struct.inc.

     9      9   ;
    10     10   ;  Dependencies:
    11     11   ;
    12     12   ;  Notes:
    13     13   ;_________________________________________________________________________________________
    14     14   
    15     15   macro struct name {
    16         -  macro name@struct \{ name name \}
    17         -  macro size@struct \{ sizeof.#name = $ \}
           16  +  macro name@struct \{
           17  +    virtual at 0
           18  +      name name
           19  +      sizeof.#name = $
           20  +    end virtual
           21  +  \}
           22  +  struc name \{
           23  +}
           24  +
           25  +
           26  +macro rstruct name {
           27  +  macro name@struct \{
           28  +    \local ..start, ..size
           29  +    virtual at -..size
           30  +      ..start:
           31  +      name name
           32  +      ..size = $ - ..start
           33  +      sizeof.#name = ..size
           34  +    end virtual
           35  +  \}
    18     36     struc name \{
    19     37   }
    20     38   
    21     39   
    22     40   ends fix } struct_helper
    23     41   
    24     42   
    25     43   macro struct_helper {
    26         -  virtual at 0
    27         -    name@struct
    28         -    size@struct
    29         -  end virtual
           44  +  name@struct
    30     45     purge name@struc
    31         -  purge size@struct
    32     46   }
    33     47