DCTOOLBAR - DCADDBUTTON tooltip not appearing

This forum is for eXpress++ general support.
Post Reply
Message
Author
Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

DCTOOLBAR - DCADDBUTTON tooltip not appearing

#1 Post by Andy Edward »

Hi Roger,

Tooltips are not appearing when using the STATIC keyword in DCADDBUTTON

I'm using Xbase 1.9.331 with Express++ 260

In the code below, the tooltip doesn't show when the mouse hovering the button.

Code: Select all

#include "DCDIALOG.CH"

PROCEDURE DbeSys() ; Return
PROCEDURE AppSys() ; Return

PROCEDURE Main()
LOCAL GetList:={}

@0,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 50,6 OBJECT oStatic1
DCSTATUSBAR oSTATTOP SPACING 3 ALIGN 1 HEIGHT 42
@0,0 DCTOOLBAR oToolBar HORIZONTAL parent oSTATTOP SIZE 800,42 PIXEL;
     TYPE XBPSTATIC_TYPE_TEXT COLOR nil, GRA_CLR_WHITE

DCADDBUTTON PARENT oToolBar ;
  TOOLTIP 'Search for An Item';
  FANCY SIZE 42,42 PIXEL;
  COLOR GRA_CLR_BLACK, XBPSYSCLR_TRANSPARENT;
  STATIC FOCUSCOLOR NIL,GRA_CLR_RED;
  BITMAP 'SEARCH.GIF'
  
DCREAD GUI MODAL FIT TITLE "BUtton Test Example" ADDBUTTONS  TO ENTRY_ACCEPTED ENTEREXIT
RETURN 
In the code below, the tooltip shows when the mouse is hovering the button. But no image is set, as BITMAP needs the STATIC Keyword

Code: Select all

#include "DCDIALOG.CH"

PROCEDURE DbeSys() ; Return
PROCEDURE AppSys() ; Return

PROCEDURE Main()
LOCAL GetList:={}

@0,0 DCSTATIC TYPE XBPSTATIC_TYPE_RECESSEDBOX SIZE 50,6 OBJECT oStatic1
DCSTATUSBAR oSTATTOP SPACING 3 ALIGN 1 HEIGHT 42
@0,0 DCTOOLBAR oToolBar HORIZONTAL parent oSTATTOP SIZE 800,42 PIXEL;
     TYPE XBPSTATIC_TYPE_TEXT COLOR nil, GRA_CLR_WHITE

DCADDBUTTON PARENT oToolBar ;
  TOOLTIP 'Search for An Item';
  FANCY SIZE 42,42 PIXEL;
  COLOR GRA_CLR_BLACK, XBPSYSCLR_TRANSPARENT
  
DCREAD GUI MODAL FIT TITLE "BUtton Test Example" ADDBUTTONS  TO ENTRY_ACCEPTED ENTEREXIT
RETURN 
The tooltip is working fine with the image in the same application compiled using an older xbase and express++

Any ideas how to resolve this?

Best Regards,

Andy

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#2 Post by rdonnay »

Yes, it would not work, because it doesn't receive mouse events, as it is STATIC.

What are you trying to do?
The eXpress train is coming - and it has more cars.

Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#3 Post by Andy Edward »

Hi Roger,

I'm trying to add a button within DCTOOLBAR with a bitmap image, but I want to still be able to show the tooltip when the mouse is hovering over the button.

Just an additional information, the first image is the application compiled under xbase 1.9.331 and express++ 260. No tooltip is showing
Untitled-2.gif
Untitled-2.gif (7.83 KiB) Viewed 10816 times
the second image is the application compiled using xbase 1.82 and Express++ 230. Tooltip is showing
Untitled-1.gif
Untitled-1.gif (7.82 KiB) Viewed 10816 times
So it stopped working when we moved to a newer version of Xbase and Express++

Any ideas?

Best Regards,

Andy

Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#4 Post by Koverhage »

Andy,

do you test ist with
xbase 1.9.331 and express++ 230 or. express++ < 255 ?
too ?
Klaus

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#5 Post by rdonnay »

Andy -

The reason it works for you in build 230 is because buttons were all based on the DC_XbpPushButton() class.

That code was written before Alaska gave us owner drawing.
Now, with owner drawing, buttons can be given many more properties.

The STATIC clause in the old buttons meant something completely different.
It meant that the button was created using XbpDialog() instead of XbpPushButton(). Back then, it was the only way I could figure out how to do create a better push button. It is not easy code to support, and thus I was elated when Alaska gave us owner drawing.

When I wrote the new DC_XbpPushButtonXP() class (based on owner drawing), I used the term STATIC to mean something entirely different than in the old class. That was an error on my part. I should have use the term NOMOUSEEVENTS, or something like that, but now it's too late because it has been in eXpress++ for over 6 years.

It never occurred to me that someone would want a tool tip on a static button, so I will have to make some changes to the source code. I can't think of a workaround at the moment.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#6 Post by rdonnay »

After looking at my source code, I realized that there should be no problem with a tooltip on a STATIC pushbutton.

Compile and run the below sample.
You will see that the tool tip shows fine on both buttons.

Code: Select all

#INCLUDE "dcdialog.ch"

FUNCTION Main()

LOCAL GetList[0], oToolBar

@ 0,0 DCTOOLBAR oToolBar SIZE 60,2 BUTTONSIZE 30,2

DCADDBUTTONXP CAPTION 'Action' PARENT oToolBar ;
      ACTION {||MsgBox('Action')} ;
      TOOLTIP 'This is a button with an Action' ;
      COLOR GRA_CLR_WHITE, GRA_CLR_DARKGREEN ;
      FONT '14.Arial Bold'


DCADDBUTTONXP CAPTION 'Static' PARENT oToolBar ;
      TOOLTIP 'This is a static button' STATIC  ;
      COLOR GRA_CLR_WHITE, GRA_CLR_DARKRED ;
      FONT '14.Arial Bold'

DCREAD GUI FIT

RETURN nil

* ----------

PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.

Andy Edward
Posts: 103
Joined: Fri Sep 17, 2010 2:58 am

Re: DCTOOLBAR - DCADDBUTTON tooltip not appearing

#7 Post by Andy Edward »

Hi Roger,

Thanks. It seems I need to change all my DCADDBUTTON to DCADDBUTTONXP commands as well.

Best Regards,

Andy

Post Reply