Page 1 of 1
Change crSQLWait to crHourGlass
Posted: Sun 30 May 2010 22:01
by palmquist
Short question
How can i change the default "busy" cursor crSQLWait to crHourGlass?
C++ Builder 2007
MyDAC mySQL 5.70.0.44
/Hannes
Posted: Mon 31 May 2010 07:28
by Dimon
To solve the problem you should create procedures that will set the needed cursor and assign it to the StartWaitProc and StopWaitProc variables. These variables are declared in the MemData unit.
Code: Select all
var
StartWaitProc: procedure;
StopWaitProc: procedure;
Posted: Mon 31 May 2010 10:00
by palmquist
I've tried that, i can assign crDefault to StartWaitProc and StopWaitProc without problems, but anything else like crHourGlass generates a error message when i try to compile it.
(I'm at work so i can't provide you with the exact error message, if you want it, I can come back to you later tonight)
I should also say i'm quite a beginner with programming.
My datamodule is created first in my application so therefor i have written the following in datamodule create method.
This code compiles
Code: Select all
StartWaitProc = crDefault;
StopWaitProc = crDefault;
This does not compile, if i recall correctly its something like "Expected void (__fastcall(*))", nothing I've seen before. And i guess thats related to the things you wrote about procedures.
Code: Select all
StartWaitProc = crHourGlass;
StopWaitProc = crDefault
I guess the problem is that i'm not 100% sure what you mean by "create a procedure". I've tried a function that return a TCursor, but i couldnt get that to work either.
A very short example would be very much appriated!
Thanks in advance!
/Hannes
Posted: Mon 31 May 2010 13:57
by Dimon
To solve the problem use the following code:
Code: Select all
void __fastcall myStartWaitProc(void)
{
Dacvcl::SetCursor(crDefault);
}
void __fastcall myStopWaitProc(void)
{
Dacvcl::SetCursor(crDefault);
}
StartWaitProc = myStartWaitProc;
StopWaitProc = myStopWaitProc;
Posted: Tue 01 Jun 2010 22:11
by eduardosic
Dimon wrote:To solve the problem use the following code:
Code: Select all
void __fastcall myStartWaitProc(void)
{
Dacvcl::SetCursor(crDefault);
}
void __fastcall myStopWaitProc(void)
{
Dacvcl::SetCursor(crDefault);
}
StartWaitProc = myStartWaitProc;
StopWaitProc = myStopWaitProc;
I can use the solution in Delphi? i think in show a screen when cursor is changed..
Posted: Wed 02 Jun 2010 08:05
by Dimon
Yes, you can assign new procedures to the StartWaitProc and StopWaitProc variables.