Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 11th, 2004, 1:00 PM   #1
misa86
Newbie
 
Join Date: Dec 2004
Posts: 6
Rep Power: 0 misa86 is on a distinguished road
Hello every1 !
I'm from Serbia and I'm a new user !

I've learned Pascal in school and I decided to make an aplication in Delphi. I make a form and beacuse that page is large i get a vertical scroll bar. But when i run in i can't use my scroll button on mouse ?

Please help me !
misa86 is offline   Reply With Quote
Old Dec 11th, 2004, 2:24 PM   #2
kurifu
Expert Programmer
 
kurifu's Avatar
 
Join Date: Jul 2004
Location: Halifax, Nova Scotia (Canada)
Posts: 784
Rep Power: 5 kurifu is on a distinguished road
Send a message via ICQ to kurifu Send a message via MSN to kurifu
You need to trap your WM_MOUSE event, find out of the control you are trying to use has focus, and if it does programatically scroll you window down. If you check the Borland Development Network (BDN.BORLAND.COM) you will actually find a solution for this problem, I have seen it posted there before.
__________________
Clifford Matthew Roche <geek@cliffordroche.com>
Web Hosting: http://www.crd-hosting.com
Consulting: http://www.crdev-consulting.com
kurifu is offline   Reply With Quote
Old Dec 12th, 2004, 10:57 AM   #3
misa86
Newbie
 
Join Date: Dec 2004
Posts: 6
Rep Power: 0 misa86 is on a distinguished road
I don't understant ?
misa86 is offline   Reply With Quote
Old Dec 12th, 2004, 11:53 AM   #4
Carl
Newbie
 
Join Date: Sep 2004
Location: Chelmsford, Essex, UK
Posts: 28
Rep Power: 0 Carl is on a distinguished road
Send a message via MSN to Carl
I pressume when you talk about the scroll button on the mouse you're talking about the wheel?

If so, each form has a OnWheelMouseUp and OnWheelMouseDown event. Code in to these what you want to happen when the user moves the mouse wheel.

For example:

procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
 MousePos: TPoint; var Handled: Boolean);
begin
 //
 // Scroll the scrollbar down by 10 pixels
 Self.VertScrollBar.Position := Self.VertScrollBar.Position + 10;
end;

If you need any more help or don't understand, please let me know.

Carl
__________________
Software developer since 1982, started on a ZX81.
Been developing in Delphi since 1998.
Currently trying to get my head round C++.
Carl is offline   Reply With Quote
Old Dec 19th, 2004, 4:50 PM   #5
misa86
Newbie
 
Join Date: Dec 2004
Posts: 6
Rep Power: 0 misa86 is on a distinguished road
Thank you Carl ! You helped me !

But there is one more thing. I learned Delphi in school and we learned it only for a few classes and I don't know how to set up little thing. For exaple :

I want to fix the width of the windows. I don't want user to expand it, but he can because when cursor is changed into tho arrows he can do that ! And just to tell you that I have a verticall scroll on that page, and at the end of the page I want some blank space but deplhi always reduces it ?
Can you help me ?
misa86 is offline   Reply With Quote
Old Dec 23rd, 2004, 3:18 AM   #6
Carl
Newbie
 
Join Date: Sep 2004
Location: Chelmsford, Essex, UK
Posts: 28
Rep Power: 0 Carl is on a distinguished road
Send a message via MSN to Carl
Quote:
I want to fix the width of the windows. I don't want user to expand it, but he can because when cursor is changed into tho arrows he can do that
There are 2 ways to go about this. The first, and probably the easiest, is to change the BorderStyle of the form to bsFixedSingle. Stops anyone from resizing the window. The second way depends on your Delphi version. Since Version 5 they have added a Constraints property to the form so you can set the minimum and maximum allowed size.

Quote:
And just to tell you that I have a verticall scroll on that page, and at the end of the page I want some blank space but deplhi always reduces it ?
Here you have to be a little clever and put a panel on the form first. The put all the controls on the panel. Delphi won't make the panel smaller and will resize the scrollbar to suit the panel.

Hope this helps.

Happy Christmas

Carl
__________________
Software developer since 1982, started on a ZX81.
Been developing in Delphi since 1998.
Currently trying to get my head round C++.
Carl is offline   Reply With Quote
Old Dec 23rd, 2004, 6:33 AM   #7
misa86
Newbie
 
Join Date: Dec 2004
Posts: 6
Rep Power: 0 misa86 is on a distinguished road
Thanx again.

In Serbia we first celebrate New Year and later Christmas !

Happy Christmas and New year !
misa86 is offline   Reply With Quote
Old Dec 26th, 2004, 2:40 PM   #8
misa86
Newbie
 
Join Date: Dec 2004
Posts: 6
Rep Power: 0 misa86 is on a distinguished road
Hi !

Another little problem.

I'm making some program and user must enter some number from 0 to 10 in edit1.text . But, how can i ban him to enter something else but number from 0 to 10 ? Because he can enter some strgin and my programme will crash.

I can make my own procedure for this but it's large, so you might have some faster solution ?
misa86 is offline   Reply With Quote
Old Dec 27th, 2004, 12:04 AM   #9
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,472
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
you should make another thread for this question... you will get more / better responses.

the the type of the value with one of the isA functions... or type cast it to an integer value... compare that value to be >= 0 and/or <= 10.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Dec 31st, 2004, 8:38 AM   #10
Carl
Newbie
 
Join Date: Sep 2004
Location: Chelmsford, Essex, UK
Posts: 28
Rep Power: 0 Carl is on a distinguished road
Send a message via MSN to Carl
Quote:
Originally posted by misa86@Dec 26 2004, 07:40 PM
Hi !

Another little problem.

I'm making some program and user must enter some number from 0 to 10 in edit1.text . But, how can i ban him to enter something else but number from 0 to 10 ? Because he can enter some strgin and my programme will crash.

I can make my own procedure for this but it's large, so you might have some faster solution ?
Although it is possible using the KeyPress event to mask out invalid characters then check the result in the Exit event, personally I prefer to use a VCL control built for the purpose.

If you visit http://www.torry.net you'll find an assortment of controls for almost every purpose. I highly recommend the JVCL which is a freeware suite of components. Takes some getting used to but well worth it.

After all, why re-invent the wheel when someone has already done it?

Carl
__________________
Software developer since 1982, started on a ZX81.
Been developing in Delphi since 1998.
Currently trying to get my head round C++.
Carl is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:04 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC