Re: [MSEide-MSEgui-talk] create component at runtime

2018-07-27 Thread code dz
2018-07-26 20:25 UTC+01:00, Martin Schreiber :
> On 07/26/2018 07:15 PM, code dz wrote:
>> Hi Martin
>> i tried to create a slider at runtime with this code , but nothing
>> appears
>>
>> procedure tmainfo.onbuttonclick(const sender: TObject);
>> var sd : tslider;
>> begin
>>  sd := tslider.create(tscrollbox1);//<<<---tscollbox1 is the owner not 
>> the
>> parentwidget
>
> "
>  sd:= tslider.create(self,tscrollbox1,true);
>  //or
>  // sd:= tslider.createandinit(self,tscrollbox1,true);
>  //if the effect should be the same as placing a component from
>  //componentpalette in MSEide
> "
>
> Martin
>

aha , thanks

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] create component at runtime

2018-07-27 Thread Martin Schreiber
On 07/26/2018 07:15 PM, code dz wrote:
> Hi Martin
> i tried to create a slider at runtime with this code , but nothing appears
> 
> procedure tmainfo.onbuttonclick(const sender: TObject);
> var sd : tslider;
> begin
>   sd := tslider.create(tscrollbox1);//<<<---tscollbox1 is the owner not 
> the parentwidget

"
 sd:= tslider.create(self,tscrollbox1,true);
 //or
 // sd:= tslider.createandinit(self,tscrollbox1,true);
 //if the effect should be the same as placing a component from
 //componentpalette in MSEide
"

Martin

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] create component at runtime

2018-07-27 Thread code dz
2018-07-26 18:15 UTC+01:00, code dz :
> Hi Martin
> i tried to create a slider at runtime with this code , but nothing appears
>
> procedure tmainfo.onbuttonclick(const sender: TObject);
> var sd : tslider;
> begin
>   sd := tslider.create(tscrollbox1);
>   sd.top := 10;
>   sd.left := 10;
>   sd.width := 100;
>   sd.height := 25;
> end;
>

seems widget constructor does not assign the parent widget . sorry i
followed the delphi way

this code works

procedure tmainfo.on_create(const sender: TObject);
var
bt : tSlider;
begin
bt := tSlider.create(nil);
bt.bounds_x := 10;
bt.bounds_y := 10;
bt.bounds_cx := 80;
bt.bounds_cy:= 20;
bt.parentwidget := self; <
end;

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


[MSEide-MSEgui-talk] create component at runtime

2018-07-26 Thread code dz
Hi Martin
i tried to create a slider at runtime with this code , but nothing appears

procedure tmainfo.onbuttonclick(const sender: TObject);
var sd : tslider;
begin
sd := tslider.create(tscrollbox1);
sd.top := 10;
sd.left := 10;
sd.width := 100;
sd.height := 25;
end;

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk