b.content.x - get property of ...structure|class|...

Виталий Фадеев vital.fadeev at gmail.com
Tue Mar 17 09:31:21 UTC 2020


Main goal is: get content "xywh" from given rect and padding.
Of course content.x is dynamic.

//
import core.sys.windows.windows;
import std.stdio;


class Base
{
     RECT rect    = { 0, 0, 500, 400 };
     RECT padding = { 10, 10, 10, 10 };

     // ...content...
     ??? content
     {
         @property int x() const { return rect.left + 
padding.left; }
     }
}

int main()
{
     auto b = new Base();
     writeln( b.content.x );
}



How to implement "b.content.x" ( sequence call "content" of the 
"b" and then "x" of that ) ?
How to implement beauty ?




More information about the Digitalmars-d-learn mailing list