MantisBT - Ecere SDK
View Issue Details
0001087Ecere SDKecerepublic2014-07-11 01:352018-08-19 17:08
jerome 
jerome 
immediatemajorhave not tried
resolvedfixed 
0.44.09 
0.44.10 640.44.10 64 
0001087: Various class:struct classes issues
- Watches on a derived class:struct member whose base class has end-padding did not work
- Alignment issues as derived classes are bundled together in a single struct
- Derived class offset was not correct
- OnGetString, OnGetDataFromString and JSON did not add class offset but should have
- typed_object& methods when called as a member of a class:struct did not have proper reference level (the address of the class:struct instance should be passed)
import "ecere"

ConsoleFile con { };

class BaseStruct : struct
{
public:
   void * type;
   int continued;
};

static class DerivedStruct : BaseStruct
{
public:
   int y, x;
};

class Form1 : Window
{
   caption = $"Form1";
   background = formColor;
   borderStyle = sizable;
   hasMaximize = true;
   hasMinimize = true;
   hasClose = true;
   clientSize = { 632, 438 };

   Button button1
   {
      this, caption = $"button1", position = { 296, 120 };

      bool NotifyClicked(Button button, int x, int y, Modifiers mods)
      {
         DerivedStruct foo { y = 4, x = 5 };
         char temp[100];
         PrintLn(foo);

         foo.OnGetString(temp, null, null);
         PrintLn(temp);

         delete foo;
         foo.OnGetDataFromString(temp);

         WriteJSONObject(con, class(DerivedStruct), foo, 0);
         return true;
      }
   };
}

Form1 form1 { };

----------------
Debugger test: Watch on foo.x should say 5
No tags attached.
Issue History
2014-07-11 01:35jeromeNew Issue
2014-07-11 01:35jeromeStatusnew => assigned
2014-07-11 01:35jeromeAssigned To => jerome
2014-07-11 01:55jeromeNote Added: 0001369
2014-07-11 01:55jeromeStatusassigned => resolved
2014-07-11 01:55jeromeFixed in Version => 0.44.10 64
2014-07-11 01:55jeromeResolutionopen => fixed
2014-08-08 18:17jeromeStatusresolved => closed
2018-08-19 17:08jeromeNote Added: 0001483
2018-08-19 17:08jeromeStatusclosed => resolved

Notes
(0001369)
jerome   
2014-07-11 01:55   
Fixed by:
https://github.com/ecere/ecere-sdk/commit/abfa4379c019b2bebc30a54331f0077bbe458208 [^]
(0001483)
jerome   
2018-08-19 17:08   
Review in light of commit
https://github.com/ecere/ecere-sdk/commit/62dd46bdb3860ba4ff7e927ad55bc0ab5877a723 [^] which partially reverts the commit that fixed this.