April 27, 2024, 12:00:11 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Windows balloon tips ?

Started by paja, June 16, 2011, 03:14:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

paja

June 16, 2011, 03:14:05 AM Last Edit: June 16, 2011, 06:23:36 PM by paja
Hi,

Please does anybody know how can I show balloon tips anywhere on the screen?

Can I put into it any image ?

Thanks

LarryMc

The tooltips section of the ControlPak help file shows you how to create balloon tooltips.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

paja

I red it. But I need place balloon tooltips anywhere - not only at control with id.

Paja

LarryMc

tooltips are tied to control ids.

It sounds like you need to make a subroutine that creates a round window that is display at the current mouse coordinates.

I think that is going to be a totally 'build your own' type of thing.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

Here's one 'build your own' method.

Maybe it could go in a subroutine with some devious logic to place the 'balloon' anywhere ..  ;D


def w:window
def wstyle,i,textW,textH:int
def a$:string

wstyle = @minbox

' open a window ..
openwindow w,0,0,600,400,wstyle,0,"Creative Basic",&messages
setwindowcolor w,rgb(0,0,30)
centerwindow w

control w,@button,"Exit",(600-70)/2,310,70,30,0,1

a$ = "A Message for you"

' show the message ...
drawmode w,@transparent
frontpen w, RGB(10,10,10)
SETFONT w, "Times New Roman",9,400
GETTEXTSIZE w, a$, textW, textH
ELLIPSE w, 220, 100, textW+50, 80 , rgb(220,220,180),rgb(220,220,180)
line w,245,200,260,160,rgb(220,220,180)
line w,245,200,280,160,rgb(220,220,180)
FLOODFILL w,255,185,rgb(220,220,180)
move w,245,130
PRINT w,a$

run = 1

WAITUNTIL run = 0
CLOSEWINDOW w
END

SUB messages
select @class
case @idclosewindow
run = 0
case @idcontrol
if @controlID = 1 then run = 0
endselect
RETURN
endsub



A bit crude, but it works OK ..

all the best, :)

Graham

Tomorrow may be too late ..

LarryMc

Graham,
That's exactly the sort of code I was talking about. :)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

paja

Thanks,

It is one way. But I would like to add balloon tips like control - it means simple to add and simple to remove and balloon tips musts go over control too.

Paja

LarryMc

Quote from: paja on June 16, 2011, 06:27:10 PM
Thanks,

It is one way. But I would like to add balloon tips like control - it means simple to add and simple to remove and balloon tips musts go over control too.

Paja

I understand. And I want to be a billionaires only son. ;D

Answer me some questions.
How do you plan to make one of these balloons appear? disappear?
How are you going to distinguish which text applies to which pixel on the screen (since you aren't using standard tooltips)?

Answer these questions and maybe someone can better help you.
A quick glance at the Windows SDK indicates you can have tracking tooltips that you can control when and where they appear.  But that section is in  a different place than the discussion about balloon tooltips.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

paja

I wanted to use balloon tips for warning and info messages for users in control system. Thus I need place it anywhere.

GWS

Still not sure what you're after Paja ..

Maybe you mean small pop-up dialog boxes containing a message which appear over a GUI control panel. But what initiates them ?

Or maybe you want messages activated by the mouse hovering over controls, like tooltips? - but not actual tooltips.

It's so difficult to communicate ideas in a few words.

best wishes, :)

Graham
Tomorrow may be too late ..

aurelCB

June 17, 2011, 06:45:32 AM #10 Last Edit: June 17, 2011, 07:23:04 AM by aurelCB
I dont see what is problem here ???
small example:
'test ToolTip
DEF w1:WINDOW
REM open the window
OPENWINDOW w1,0,0,600,400,@MINBOX,0,"Simple Window",&main
REM print a message
SETWINDOWCOLOR w1,RGB(220,220,230)
'----------------------------------------------------------
CONTROL w1,@SYSBUTTON,"Button1",10,18,94,38,0x50000000,1

CONTROL w1,@EDIT,"Edit1",121,20,370,174,0x50B010C4,2

'create the tool tip control
hTooltip = ToolTipControl(w1,@TTS_ALWAYSTIP|@TTS_BALLOON,0)
'add tooltips for our buttons
ttAddTool hTooltip,@TTF_SUBCLASS|@TTF_IDISHWND,GetControlHandle(w1,1),hTooltip,"Button number one"
ttAddTool hTooltip,@TTF_SUBCLASS|@TTF_IDISHWND,GetControlHandle(w1,2),hTooltip,"Type your text here!"





WAITUNTIL w1 = 0
END
'---
REM every time there is a message for our window

SUB main
'IF @hitwindow=*<window>pw
IF @message= @IDCREATE
CENTERWINDOW #<WINDOW>@HITWINDOW
ENDIF


IF @Message = @IDCLOSEWINDOW
        CLOSEWINDOW w1
'IF *<window>pw2<>0 THEN CLOSEWINDOW *<window>pw2
ENDIF
'ENDIF
RETURN
ENDSUB




You can also read this article:
http://www.codeproject.com/KB/miscctrl/ballontooltip.aspx?msg=2753065

paja

Hi,

Nice - OK. But as I wrote I need show balloon tips anywhere according program request - not only on mouse over.

Paja

billhsln

Sounds more like you want to put out a MESSAGEBOX on program errors.

Bill
When all else fails, get a bigger hammer.

paja

No message box. Balloon tip can show on real place what I want. I need write any messages into balloon tip.

LarryMc

Again,
QuoteHow do you plan to make one of these balloons appear? disappear?
How are you going to distinguish which text applies to which pixel on the screen (since you aren't using standard tooltips)?

Answer these questions and maybe someone can better help you.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

QuoteNice - OK. But as I wrote I need show balloon tips anywhere according program request - not only on mouse over.

Larry is right...
How you mean ,i mean by which trigger you mean to open ballon tip on any place
of screen - not window ???
I dont see any kind of program that can do that...

aurelCB

Or maby you mean on something like 'sticky note' -which is infact nocaption
dragable window....

paja

I use RGNBUTTONs like devices on the screen in control process program and I would like use balloon tips to inform user about devices status according program request.

LarryMc

Maybe we're getting somewhere.

You say RGNBUTTON like devices.  Do they have a windows handle?
LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

GWS

I think we may have been here before ..  ::)

http://www.ionicwind.com/forums/index.php?topic=3622.0

A bit of example code, or more explanation is probably needed.

all the best, :)

Graham
Tomorrow may be too late ..

paja

I have control program for some devices. RGNBUTTON is like picture of device shown on the screen (window). Thus my program is used for move devices in the area and on the screen I see some parameters for example positions. And sometimes I would like to  show balloon tip for this RGNBUTTON with more info about devices. But without "mouse over" function.



LarryMc

Okay.
How do you determine when to show balloon and not show balloon since you don't want to use mouseover?
Do these 'images' always appear in the same spots on the screen?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

paja

June 17, 2011, 10:46:11 AM #22 Last Edit: June 17, 2011, 10:54:01 AM by paja
For move devices is used the joystick. The communication with devices is over RS485 bus - both ways direction. For example - when devices has some error I would like to see it in balloon tip.

LarryMc

How it communicates has nothing to do with the problem.

Is the following correct:
1. You have an image on the screen that is not associated to any control handle.
2. You move a joy stick and the image on the screen moves.
3. If the external object has a problem you want a balloon to appear on the associated image on the screen (where ever the image may currently be on the screen).

Again, are the 3 statements 100% correct?

If so, does the balloon stay until the error goes away or,
Does it go away when the user acknowledges the error?

Can you provide a screenshot?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

30 years ago we did the following for devices controlled from a screen.
All the images(symbols for equipment) on the screen had fixed locations.
We used multiple pages to show more devices than what would fit on one screen.
All the symbols used 3 different colors that defined the devices current state.

At the bottom of all pages was a 3 line scrolling listbox.
When devices alarmed(had an error) a new line was added to the top of the listbox and was made to flash.
When the alarm was acknowledged the line would still be there if it was still in an alarm state.
If it was no longer in the alarm state the line would disappear, if it had been acknowledged.

The whole idea was that there was no way the User could miss something that had happened because they were on phone, bathroom, etc.

That system had 10,000 devices attached and almost 200 pages(screens)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library