 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Adam Sandler Guest
|
Posted: Thu Sep 29, 2005 4:13 pm Post subject: Where is TApplication located? |
|
|
Hello,
I've been told to do something I'm planning on doing I need to drop a
TApplication object on my form. I'm pulling my hair out trying to find
out where this component is. What toolbar is TApplication on? What
does its icon look like?
Thanks!
|
|
| Back to top |
|
 |
Maarten Wiltink Guest
|
Posted: Thu Sep 29, 2005 5:57 pm Post subject: Re: Where is TApplication located? |
|
|
"Adam Sandler" <corn29 (AT) excite (DOT) com> wrote
| Quote: | I've been told to do something I'm planning on doing I need to drop a
TApplication object on my form. I'm pulling my hair out trying to find
out where this component is. What toolbar is TApplication on? What
does its icon look like?
|
The Forms unit creates a TApplication object in its initialisation
section. It represents the entirety of your program, tt's not something
you drop on a form.
There _is_ a TApplicationEvents in (later versions of) Delphi, and
that is something you drop on a form. In Delphi 5, it's on the
Additional tab and looks like the little torch on a blue globe that
is (was?) the default icon for applications, with arrows pointing
away from it.
So, considering that apparently what you were told (or perhaps your
recollection of it) wasn't overly accurate, what were you planning
on doing?
Groetjes,
Maarten Wiltink
|
|
| Back to top |
|
 |
Adam Sandler Guest
|
Posted: Thu Sep 29, 2005 9:23 pm Post subject: Re: Where is TApplication located? |
|
|
I'm trying to correct some buggy mouse wheel behavior in the DBGrid...
A colleague told me how to fix it and sent me this URL...
http://delphi.about.com/cs/adptips2002/a/bltip1102_3.htm
Thanks for the help.
|
|
| Back to top |
|
 |
Nicholas Sherlock Guest
|
Posted: Fri Sep 30, 2005 12:57 am Post subject: Re: Where is TApplication located? |
|
|
Adam Sandler wrote:
Whoever wrote that article is a little weird. Use the routine given, but
make it a method of your form:
procedure TForm1.OnMessage
(var Msg: TMsg; var Handled: Boolean) ;
var
i: SmallInt;
begin
if Msg.message = WM_MOUSEWHEEL then
begin
Msg.message := WM_KEYDOWN;
Msg.lParam := 0;
i := HiWord(Msg.wParam) ;
if i > 0 then
Msg.wParam := VK_UP
else
Msg.wParam := VK_DOWN;
Handled := False;
end;
end;
Then in your form's oncreate:
application.onmessage:=onmessage;
Cheers,
Nicholas Sherlock
|
|
| Back to top |
|
 |
Maarten Wiltink Guest
|
Posted: Fri Sep 30, 2005 8:20 am Post subject: Re: Where is TApplication located? |
|
|
"Nicholas Sherlock" <n_sherlock (AT) hotmail (DOT) com> wrote
Zarko Gajic. His name seems to come up rather often there.
| Quote: | Use the routine given, but make it a method of your form:
|
<snip code>
| Quote: | Then in your form's oncreate:
application.onmessage:=onmessage;
|
Some people thrive on programming by clicking alone, and would
benefit (in a short term sense) from using a TApplicationEvents
component to put this in its place.
Zarko arguably made a speeling mistake, but I wouldn't class him
as "weird" for that. As for catering to doubleclick-dummies...
Groetjes,
Maarten Wiltink
|
|
| Back to top |
|
 |
Nicholas Sherlock Guest
|
Posted: Fri Sep 30, 2005 8:29 am Post subject: Re: Where is TApplication located? |
|
|
Maarten Wiltink wrote:
| Quote: | Zarko arguably made a speeling mistake, but I wouldn't class him
as "weird" for that. As for catering to doubleclick-dummies...
|
Ah, wasn't aware of this component (Never used it before). Forget my
comment, then .
Cheers,
Nicholas Sherlock
|
|
| Back to top |
|
 |
Ante Smolcic Guest
|
Posted: Fri Sep 30, 2005 11:41 am Post subject: Re: Where is TApplication located? |
|
|
In article <dhi2j4$si4$1 (AT) lust (DOT) ihug.co.nz>, [email]n_sherlock (AT) hotmail (DOT) com[/email]
says...
| Quote: | Adam Sandler wrote:
I'm trying to correct some buggy mouse wheel behavior in the DBGrid...
A colleague told me how to fix it and sent me this URL...
http://delphi.about.com/cs/adptips2002/a/bltip1102_3.htm
Whoever wrote that article is a little weird. Use the routine given, but
make it a method of your form:
|
I would also suggest correcting the if satement condition to also check
if the Msg.Hwnd belongs to a TDBGrid descendant.
Also, one wheel message by defaut transcribes to 3 key messages, right?
It should be possible to get this value.
--
I'm not having these two shag while I'm tied to a chair three feet away.
|
|
| Back to top |
|
 |
Henry Bartlett Guest
|
Posted: Fri Sep 30, 2005 11:26 pm Post subject: Re: Where is TApplication located? |
|
|
"Ante Smolcic" <supersmola (AT) hr (DOT) inet> wrote
| Quote: | Also, one wheel message by defaut transcribes to 3 key messages,
right?
It should be possible to get this value.
|
Try this
function GetScrollLines: integer;
begin
if not SystemParametersInfo (spi_GetWheelScrollLines, 0, @Result, 0)
then
Result := 3;
end;
My copy of Win32.hlp says
BOOL SystemParametersInfo(
UINT uiAction, // system parameter to query or set
UINT uiParam, // depends on action to be taken
PVOID pvParam, // depends on action to be taken
UINT fWinIni // user profile update flag
);
<snip>
SPI_SETWHEELSCROLLLINES Windows NT only: Sets the number of lines to
scroll when the mouse wheel is rotated. The number of lines is set
from the uiParam parameter.
--
Henry Bartlett
Delphi Links Page:
( http://www.hotkey.net.au/~hambar/habit/delflink.htm )
|
|
| 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
|
|