BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

borderstyle in construction

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
daniel
Guest





PostPosted: Thu Dec 11, 2003 10:24 am    Post subject: borderstyle in construction Reply with quote



allo,

code sample :-

constructor TScrollBoxEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle := bsNone;
......
end;

now the compiler gave an error like:
Incompatible types:'forms.TBorderStyle' and 'scrollboxex.TBorder'

what can i do to overcome that.

ciao
daniel




Back to top
Nicolai Hansen
Guest





PostPosted: Thu Dec 11, 2003 2:50 pm    Post subject: Re: borderstyle in construction Reply with quote



Quote:
constructor TScrollBoxEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle := bsNone;
.....
end;

now the compiler gave an error like:
Incompatible types:'forms.TBorderStyle' and 'scrollboxex.TBorder'

How is "BorderStyle" defined? BorderStyle: TBorder; ?

Also for your last post, you could maybe try to use

BorderStyle: Forms.TBorderStyle;

I have only seen problems like this once before when some friends were
messing round with some COM objects. In other programming languages I
would say you were missing the wrong namespace... but Delphi does not
really use namespaces?

Back to top
Maarten Wiltink
Guest





PostPosted: Thu Dec 11, 2003 3:19 pm    Post subject: Re: borderstyle in construction Reply with quote



"Nicolai Hansen" <nic (AT) aub (DOT) dk> wrote

[...]
Quote:
I have only seen problems like this once before when some friends were
messing round with some COM objects. In other programming languages I
would say you were missing the wrong namespace... but Delphi does not
really use namespaces?

No, but qualifying identifiers with unit names serves much the same
purpose.

Groetjes,
Maarten Wiltink



Back to top
daniel
Guest





PostPosted: Thu Dec 11, 2003 5:22 pm    Post subject: Re: borderstyle in construction Reply with quote

allo nicolai,

if you re-look at my code excerpt,
Quote:
1 > constructor TScrollBoxEx.Create(AOwner: TComponent);
2> begin
3> inherited Create(AOwner);
4> BorderStyle := bsNone;
5> .....
6> end;

in 4 above, is the problem line pointed out by the compiler.
what I want is that any new object "ScrollBoxEx1 for example", created by
calling that constructor will have the borderStyle set to bsNone.

but that problem halted my work, so please help.

thanks.
daniel



"Nicolai Hansen" <nic (AT) aub (DOT) dk> wrote

Quote:
constructor TScrollBoxEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle := bsNone;
.....
end;

now the compiler gave an error like:
Incompatible types:'forms.TBorderStyle' and 'scrollboxex.TBorder'

How is "BorderStyle" defined? BorderStyle: TBorder; ?

Also for your last post, you could maybe try to use

BorderStyle: Forms.TBorderStyle;

I have only seen problems like this once before when some friends were
messing round with some COM objects. In other programming languages I
would say you were missing the wrong namespace... but Delphi does not
really use namespaces?



Back to top
Nicolai Hansen
Guest





PostPosted: Fri Dec 12, 2003 7:12 am    Post subject: Re: borderstyle in construction Reply with quote

"daniel" <mrdaniel (AT) singnet (DOT) com.sg> wrote

Quote:
allo,

code sample :-

constructor TScrollBoxEx.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
BorderStyle := bsNone;
.....
end;

now the compiler gave an error like:
Incompatible types:'forms.TBorderStyle' and 'scrollboxex.TBorder'

The error tells you:
FIRST argument (BorderStyle) is of the type "forms.TBorderStyle".
SECOND argument (bsNone) is of the type "scrollboxex.TBorder".
"forms.TBorderStyle"<>"scrollboxex.TBorder".

This is like trying to assign an integer to a string.

I would think that in the ScrollBoxEx unit somewhere there was a
definition like

TBorder=(bsNone, bsDouble, bsSingle);

which makes the use of "bsNone" inside the scrollboxex creator point
to a TBorder type. Your scrollboxex probably have a property

property BorderStyle: TBorderStyle;

which is found in the forms unit, defined as

TFormBorderStyle = (bsNone, bsSingle, bsSizeable, bsDialog,
bsToolWindow,
bsSizeToolWin);
TBorderStyle = bsNone..bsSingle;

Even though your definition in your unit is excactly the same as this.
Even if your definition is just "TBorder=bsNone..bsSingle"... it will
give a conflict between the types.

To fix, I would suggest removing the TBorder definition unless it is
used elsewhere. Post code.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.