View previous topic :: View next topic |
Author |
Message |
peter
Joined: 05 Jun 2007 Posts: 7 Location: Germany
|
Posted: Wed Jun 06, 2007 6:10 am Post subject: Panel with Scrollbars |
|
|
Hi,
one more question :
How can I activate the scrollbars on a panel ?
I saw that panel is derived from ContainerControl which is derived from
ScrollableControl which should be able to do this.
Dokumentation at wiki.dprogramming.com/DflDoc is a good start
but there is no explanation about the methods.
I use the Panel as Container for a picturebox.
Picturebox or Picture inside should be larger than the panel itself and
therefore scrollable.
(In a second step the picturebox shall get a zoom funktion too. I got this working with DockStyle and Size of the picturebox.)
Thank You _________________
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Wed Jun 06, 2007 11:53 am Post subject: Re: Panel with Scrollbars |
|
|
DFL comes with example scroller.d that shows scrolling. It involves properties hScroll, vScroll and scrollSize.
Form is also derived from ScrollableControl and is scrollable in the same way as Panel. |
|
Back to top |
|
|
peter
Joined: 05 Jun 2007 Posts: 7 Location: Germany
|
Posted: Wed Jun 06, 2007 3:02 pm Post subject: Panel with Scrollbars |
|
|
Hi Chris,
yes, I've seen this and I tried to do it this way first :
// Do not modify or move this block of variables.
//~Entice Designer variables begin here.
dfl.panel.Panel panel1;
dfl.picturebox.PictureBox pictureBox2;
//~Entice Designer variables end here.
private void initializeMyForm()
{
// Do not manually modify this function.
//~Entice Designer 0.8.2.1 code begins here.
//~DFL Form
text = "My Form";
clientSize = dfl.drawing.Size(292, 273);
//~DFL dfl.panel.Panel=panel1
panel1 = new dfl.panel.Panel();
panel1.name = "panel1";
panel1.bounds = dfl.base.Rect(8, 48, 272, 160);
panel1.parent = this;
//~DFL dfl.picturebox.PictureBox=pictureBox2
pictureBox2 = new dfl.picturebox.PictureBox();
pictureBox2.name = "pictureBox2";
pictureBox2.bounds = dfl.base.Rect(8, 48, 400, 200);
pictureBox2.parent = panel1;
//~Entice Designer 0.8.2.1 code ends here.
panel1.scrollSize = Size(400, 200);
panel1.vScroll = true;
panel1.hScroll = true;
But vScroll and hScroll seem to be private members of panel :
Compiling in debug mode; use -release to compile in release mode
C:\PROGRA~1\D\dmd\bin\dmd.exe myform -version=DFL_EXE -debug -IC:\PROGRA~1\D\dmd
\import -L/exet:nt/su:windows:4.0 C:\PROGRA~1\D\dmd\lib\DFL_DE~1.LIB
myform.d(47): class dfl.panel.Panel member vScroll is not accessible
myform.d(4: class dfl.panel.Panel member hScroll is not accessible
Returned status code 1
I then tried :
panel1.vScroll(true);
panel1.hScroll(true);
with the same error during compile.
I am not quite sure about my OOP know-how but could it be that the reason for getting the error is that those functions are defined :
protected final void hScroll(bool byes)
So the only way is to construct a class mypanel first ?
Greetings
Peter
ps: I really like your work _________________
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Fri Jul 06, 2007 11:12 am Post subject: Re: Panel with Scrollbars |
|
|
For now you will have to derive from the class to change the hScroll/vScroll; however, they will be made public soon. |
|
Back to top |
|
|
|