Change crSQLWait to crHourGlass

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
palmquist
Posts: 4
Joined: Fri 21 Aug 2009 12:04

Change crSQLWait to crHourGlass

Post by palmquist » Sun 30 May 2010 22:01

Short question :)

How can i change the default "busy" cursor crSQLWait to crHourGlass?

C++ Builder 2007
MyDAC mySQL 5.70.0.44

/Hannes

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 31 May 2010 07:28

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;

palmquist
Posts: 4
Joined: Fri 21 Aug 2009 12:04

Post by palmquist » Mon 31 May 2010 10:00

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

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 31 May 2010 13:57

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;

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Tue 01 Jun 2010 22:11

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..

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 02 Jun 2010 08:05

Yes, you can assign new procedures to the StartWaitProc and StopWaitProc variables.

Post Reply