[Lazarus] How to convert it to FPC/Lazarus

classic Classic list List threaded Threaded
3 messages Options
ik
Reply | Threaded
Open this post in threaded view
|

[Lazarus] How to convert it to FPC/Lazarus

ik
Hello,

I have a Delphi based program that I try to rewrite for Lazarus (The original code is not mine).

There is a code there like so:

type
  TTab = (ttOne, ttTwo, ttThree);

  TTabs = set of TItems;

...
procedure DisplayTabs(Display : TTabs);
var                                                                                                                                        
 i:integer;                                                                                                                                
begin                                                                                                                                      
 Tabs:=Display;                                                                                                                           
 for i:=0 to PageControl.PageCount-1 do begin                                                                                              
  PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how to make this work ?
 end;                                                                                                                                      
 PageControl.ActivePageIndex:=ord(Display);
end;
...

I rewrote it for the example here,but that's the same code. How can I make it work in FPC+Lazarus ?

Thanks,
Ido


--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to convert it to FPC/Lazarus

michael.vancanneyt


On Tue, 12 Apr 2011, ik wrote:

> Hello,
>
> I have a Delphi based program that I try to rewrite for Lazarus (The
> original code is not mine).
>
> There is a code there like so:
>
> type
>  TTab = (ttOne, ttTwo, ttThree);
>
>  TTabs = set of TItems;
>
> ...
> procedure DisplayTabs(Display : TTabs);
> var
>
> i:integer;
>
> begin
>
> Tabs:=Display;
>
> for i:=0 to PageControl.PageCount-1 do
> begin
>
>  PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how to
> make this work ?

   PageControl.Pages[i].TabVisible:= TTab(I) in Display

Michael.

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
ik
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to convert it to FPC/Lazarus

ik





On Tue, Apr 12, 2011 at 16:52, <[hidden email]> wrote:


On Tue, 12 Apr 2011, ik wrote:

Hello,

I have a Delphi based program that I try to rewrite for Lazarus (The
original code is not mine).

There is a code there like so:

type
 TTab = (ttOne, ttTwo, ttThree);

 TTabs = set of TItems;

...
procedure DisplayTabs(Display : TTabs);
var

i:integer;

begin

Tabs:=Display;

for i:=0 to PageControl.PageCount-1 do
begin

 PageControl.Pages[i].TabVisible:= word(Display) and (1 shl i)>0; // how to
make this work ?

 PageControl.Pages[i].TabVisible:= TTab(I) in Display


That's more simple :) Thanks.
 
Michael.

 

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Ido

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus