 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
daniel Guest
|
Posted: Thu Dec 11, 2003 10:24 am Post subject: borderstyle in construction |
|
|
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
|
Posted: Thu Dec 11, 2003 2:50 pm Post subject: Re: borderstyle in construction |
|
|
| 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
|
Posted: Thu Dec 11, 2003 3:19 pm Post subject: Re: borderstyle in construction |
|
|
"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
|
Posted: Thu Dec 11, 2003 5:22 pm Post subject: Re: borderstyle in construction |
|
|
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
|
Posted: Fri Dec 12, 2003 7:12 am Post subject: Re: borderstyle in construction |
|
|
"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 |
|
 |
|
|
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
|
|