Index: freshlib/data/strlib.asm ================================================================== --- freshlib/data/strlib.asm +++ freshlib/data/strlib.asm @@ -16,20 +16,17 @@ module "String library" STR_MINSTRLEN = 127 ; must be N*8-1 STR_SEARCH_ONE_ATEMPT = 100 -struc string { + +rstruct string .capacity dd ? .len dd ? - label .data byte -} + . rb 0 +ends -virtual at -(sizeof.string) - string string - sizeof.string = $-string -end virtual ; NumToStr flags ntsSigned = $00000 ntsUnsigned = $10000 Index: freshlib/gui/OldTemplates.inc ================================================================== --- freshlib/gui/OldTemplates.inc +++ freshlib/gui/OldTemplates.inc @@ -15,11 +15,11 @@ macro Window name, flags, walign, class, txt, style, styleEx, ID, left, top, width, height, [props] { common - local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign + local ..paramsize, ..prms, ..caption, ..name, ..subtype, ..txtalign, ..class ..subtype = style and $0f ..txtalign = 0 @@ -28,41 +28,43 @@ end if ; flags dd flags ; the values are the same + ..class = CWindow + ; class if class eq 'TForm' - dd CForm + ..class = CForm else if class eq 'BUTTON' if ..subtype = 0 ; BS_PUSHBUTTON - dd CButton + ..class = CButton ..txtalign = dtfAlignCenter or dtfAlignMiddle end if if ..subtype = 2 ; BS_CHECKBOX - dd CCheckBox + ..class = CCheckBox end if if ..subtype = 4 ; BS_RADIOBUTTON - dd CRadioButton + ..class = 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. + ..class = CFreshEdit ; it is not good to use CFreshEdit, but we don't have light multiline edit. else - dd CEdit + ..class = CEdit end if else if class eq 'STATIC' - dd CLabel + ..class = CLabel if ..subtype = 1 ; SS_CENTER ..txtalign = ..txtalign or dtfAlignCenter end if @@ -74,19 +76,19 @@ ..txtalign = ..txtalign or dtfAlignMiddle end if else if class eq 'msctls_progress32' - dd CProgress - else - err 'Invalid class.' + ..class = CProgress end if end if end if end if end if + + dd ..class ; name if name eq NONE dd ..name else @@ -110,20 +112,28 @@ dd width dd TWindow.height dd height - dd TWindow.Caption + 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 eq 'BUTTON' + if ..class = CButton dd TButton.TextAlign else dd TLabel.TextAlign end if dd ..txtalign Index: freshlib/macros/_struct.inc ================================================================== --- freshlib/macros/_struct.inc +++ freshlib/macros/_struct.inc @@ -11,23 +11,37 @@ ; ; Notes: ;_________________________________________________________________________________________ macro struct name { - macro name@struct \{ name name \} - macro size@struct \{ sizeof.#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 { - virtual at 0 - name@struct - size@struct - end virtual + name@struct purge name@struc - purge size@struct }