Solved

Which component should i use to draw on.

Posted on 2007-04-03
18
253 Views
Last Modified: 2010-04-05
Dear Experts,

Again I need your advice.

Thank to you guys I have a good example of a telnet-programm
and it works like a clock. All the features works great.

I have put the example on my site:
http://members.home.nl/peterkiers/ 
(Beneath the Under Construction bar you see a floppy-disk)

The example draws on the canvas of the form.
But when I want to add a toolbar on the form, a part of the canvas
gets hidden!

1. Shouldn't I better use a component to draw on? And which one should I use?
2. I have tried to use the component TImage to draw on
    but then several features in the example doesn't work that good anymore!
 
I get a little frustrated.

Who can help me?

Greetings,

Peter Kiers





0
Comment
Question by:peterkiers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 3
18 Comments
 
LVL 21

Expert Comment

by:ziolko
ID: 18843454
you can try this, write your own component based on TCustomPanel and expose Canvas property to public section.

TMyDrawingPanel = class(TCustomPanel)
public
  property Canvas;
end;

ziolko.
0
 
LVL 28

Accepted Solution

by:
2266180 earned 250 total points
ID: 18843463
1. it is indeed the best solution. I suggest a TCustomPanel or descendant
2. see 1 :) TImage has to much overhead for what you need.
0
 
LVL 28

Expert Comment

by:2266180
ID: 18843471
hehe, same minute posting :)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Assisted Solution

by:ziolko
ziolko earned 250 total points
ID: 18843477
btw. you can write your own constructor in TMyDrawingPanel to
set your panel to suit you like BeverOuter := bvNone, caption := '' etc

ziolko.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843504
yup it was matter of seconds:)

ziolko.
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843521
peter look at ciuly's points and on mine i'm sure this will help you make right decision which comment you should accept ;)

ziolko.
0
 
LVL 1

Author Comment

by:peterkiers
ID: 18843545
Is it maybe possible to help me with it, at least to give a beginning.

Peter Kiers
0
 
LVL 28

Expert Comment

by:2266180
ID: 18843591
> peter look at ciuly's points and on mine i'm sure this will help you make right decision which comment you should accept ;)

rofl

I could still steal them from you, if I toss him some example :P so hurry up ;)
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843607
that's all you need:
interface
TMyDrawingPanel = class(TCustomPanel)
public
  constructor Create(AOwner: TComponent); override;
  property Canvas;
end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('My Component', [TMyDrawingPanel]);
end;


constructor TMyDrawingPanel.Create(AOwner: TComponent);
begin
  inherited;
  BevelOuter := bvNone;
  Caption := '';
end;

you can write it in separate .pas file and install it as any other component :)
0
 
LVL 1

Author Comment

by:peterkiers
ID: 18843617
I choose the advice from Ciuly
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843628
ciuly are you trying to take advantage of fact that my boss is looking over my shoulder? ;)

ziolko.
0
 
LVL 28

Expert Comment

by:2266180
ID: 18843638
>I choose the advice from Ciuly
rolf

just in case that wasn't a joke :) peter, keep in mind that my advice is almost the same as ziolkos and he was first ;) (plus he gave code, which again is an important factor when deciding)
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843644
>>I choose the advice from Ciuly

peter you too against me?:)
i'll show you, both of you, you'll remember me forever:)

ziolko.
0
 
LVL 28

Expert Comment

by:2266180
ID: 18843656
>ciuly are you trying to take advantage of fact that my boss is looking over my shoulder? ;)
become a freelancer and work from home, like I did. only problem is when wife gets home, you can't do "overtime" :D
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843672
heh i thought abt that... but f*** boss i'm looking for new job anyway :)

ziolko.
0
 
LVL 1

Author Comment

by:peterkiers
ID: 18843811
Thanks both for the advice.

Peter Kiers
0
 
LVL 28

Expert Comment

by:2266180
ID: 18843855
hm... I know from the expert skin there is no way of telling which answer will be accepted (though I thinkit's eitehr the first or teh one with biggest number of points) so I hope it was ziolkos answer you wanted to accept and mine to assist ... because this is the correct way, as I already explained above.

and if indeed you wanted to accept ziolkos answer, then I'll take this opportunity to state again that the new interface ... is way below aspectations (to say the least).
0
 
LVL 21

Expert Comment

by:ziolko
ID: 18843971
skin is not that bad, couple o few featuers are cool but cross-topic Qs...
ziolko.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question