Tooltip with multiline

Moderator: Rathinagiri

User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: ToolTip in IMAGE control

Post by esgici »

Amarante wrote: Friend esgici
Sorry I used your post to solve my problem.
I hope it has not offended. :roll:
No problem amigo :arrow:

Our ( almost all of us ) purpose is learn more about we don't know.

Only problem is language barrier; someone want to hide their knowledge from out of who don't know their language :?

Anyway Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

ToolTip in IMAGE control

Post by Pablo César »

Amarante wrote: Ops, :o
Vi essa linha em seu exemplo:
SendMessage( GetFormToolTipHandle ("Form_1"), TTM_SETMAXTIPWIDTH, 0, 168)
E mudei o meu exemplo e funcionou! :D
Quê bom, fico feliz saber que conseguiu. :) Você é um ótimo programador, que observa com atenção. Parabéns !

É o tamanho do tooltip que estava afetando...

---

That is good, I'm glad to know you got it ! :)

The main reason was the size of the tooltip that was affecting ...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Amarante
Posts: 182
Joined: Fri Apr 27, 2012 9:44 pm
DBs Used: DBF, MySQL, MariaDB, SQLite, PostgreSQL
Location: Araruama-RJ, Brazil

Re: ToolTip in IMAGE control

Post by Amarante »

Pablo, Daniel and Esgici
Thank you friends.

Pablo, a curiosity:
The Tooltip works with both CRLF chr (13) + chr (10) as only with LF chr (10).
LF (Line Feed) always seemed more appropriate because the CR (Carriage Return) does not make much sense since we are not manipulating cursor or printer.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: ToolTip in IMAGE control

Post by srvet_claudio »

danielmaximiliano wrote:Hola claudio :
cuando creo/defino un control Image le otorgo un nombre, pero cuando utilizo

Code: Select all

*-------------------------------------------------------------*
PROCEDURE ON_INIT_Principal()
*-------------------------------------------------------------*
Local cControlName 
Local cFormParentName := "Principal"
   hBitmap := BT_BitmapLoadFile ( "LosTilos" )
RETURN

*-------------------------------------------------------------*
PROCEDURE ON_PAINT_Principal()
*-------------------------------------------------------------*
LOCAL hDC, BTstruct
   hDC := BT_CreateDC ( "Principal" , BT_HDC_INVALIDCLIENTAREA , @BTstruct)
  [b] BT_DrawBitmap ( hDC , 165 ,   5 , 990            , 500           , BT_STRETCH  , hBitmap )[/b]
   BT_DeleteDC    ( BTstruct )
RETURN
¿ como se que nombre tiene dicha imagen ? o ¿ tengo que crearla como Control de HMG ?
Hola Daniel,
las imágenes se identifican mediante su handle:
hBitmap1 := BT_BitmapLoadFile ( "LosTilos1" )
hBitmap2 := BT_BitmapLoadFile ( "LosTilos2" )
hBitmap3 := BT_BitmapLoadFile ( "LosTilos3" )

también podes usar para asignar/obtener las images de un control Image las siguientes funciones:

BT_HMGGetImage (cFormName, cControlName)
Returns the handle of the bitmap associated to an Image Control of HMG (@...IMAGE).
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.

BT_HMGCloneImage (cFormName, cControlName)
Clones the bitmap associated to an Image Control of HMG (@...IMAGE) and returns a
handle to the cloned bitmap.
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.

BT_HMGSetImage (cFormName, cControlName, hBitmap)
Sets a specified bitmap into an Image Control of HMG (@...IMAGE) and automatically
releases the handle of the bitmap previously associated to the Image Control.
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.
hBitmap: is a handle to the bitmap to set.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: ToolTip in IMAGE control

Post by esgici »

srvet_claudio wrote:...también podes usar para asignar/obtener las images de un control Image las siguientes funciones:...
Hi Claudio

Gratifying to take care of this topic ;)

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: ToolTip in IMAGE control

Post by srvet_claudio »

esgici wrote:
srvet_claudio wrote:...también podes usar para asignar/obtener las images de un control Image las siguientes funciones:...
Hi Claudio

Gratifying to take care of this topic ;)

Happy HMG'ing :D
Ok, Friend.
This post is not related to the title of this topic (tooltip Image control) is a response to a question about BT.

In BT the the images are identified by the associated handle, e.g.

hBitmap1 := BT_BitmapLoadFile ( "LosTilos1" )
hBitmap2 := BT_BitmapLoadFile ( "LosTilos2" )
hBitmap3 := BT_BitmapLoadFile ( "LosTilos3" )

Can also be used to assign / get the picture of an Image control the following functions (see C:\hmg.3.1.5\hfcl\Samples\BosTaurus\demo13):

BT_HMGGetImage (cFormName, cControlName)
Returns the handle of the bitmap associated to an Image Control of HMG (@...IMAGE).
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.

BT_HMGCloneImage (cFormName, cControlName)
Clones the bitmap associated to an Image Control of HMG (@...IMAGE) and returns a
handle to the cloned bitmap.
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.

BT_HMGSetImage (cFormName, cControlName, hBitmap)
Sets a specified bitmap into an Image Control of HMG (@...IMAGE) and automatically
releases the handle of the bitmap previously associated to the Image Control.
cFormName: is the name (e.g. "Win1") of the parent window.
cControlName: is the name (e.g. "Image1") of the image control.
hBitmap: is a handle to the bitmap to set.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
emzampi
Posts: 106
Joined: Sun Aug 11, 2013 9:00 am

Re: Tooltip with multiline

Post by emzampi »

Goodmorning everyone,
I'm trying again and again to use the multi-line tooltip on the textbox control but I can not make it work.
Have any of you like to try the example C: \ hmg.3.4.3 \ SAMPLES \ Controls \ TextBox \ TEXTBOX_2


thank you
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Tooltip with multiline

Post by Pablo César »

Hi all and ciao Emanuele,

Are you trying with:

#define TTM_SETMAXTIPWIDTH 0x0418

...
END WINDOW
SendMessage( GetFormToolTipHandle ("Form_1"), TTM_SETMAXTIPWIDTH, 0, 168)

and CRLF in ToolTips ?
emzampi wrote:Have any of you like to try the example C: \ hmg.3.4.3 \ SAMPLES \ Controls \ TextBox \ TEXTBOX_2
For me it is working properly.

Code: Select all

/*
 * HMG - Harbour Win32 GUI library Demo
 *
 * Copyright 2002 Roberto Lopez <mail.box.hmg@gmail.com>
 * http://www.hmgforum.com//
*/

#include "hmg.ch"

// #define WM_USER                      0x400
// #define TTM_SETMAXTIPWIDTH           (WM_USER + 24)

#define TTM_SETMAXTIPWIDTH           0x0418


Function Main

	SET NAVIGATION EXTENDED
	SET EPOCH TO 2000

	SET CENTURY ON
	SET DATE FRENCH

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 640 HEIGHT 480 ;
		TITLE 'HMG Demo' ;
		MAIN 

		DEFINE MAIN MENU
			DEFINE POPUP 'Test'
				MENUITEM 'Set Text_1 Value' ACTION Form_1.Text_1.Value := Date()
				MENUITEM 'Set Text_2 Value' ACTION Form_1.Text_2.Value := ctod ('  /  /  ')
				MENUITEM 'Set Text_3 Value' ACTION Form_1.Text_3.Value := ctod('01/01/2005')
				MENUITEM 'Set Text_1 ReadOnly' ACTION Form_1.Text_1.ReadOnly := .T.
				MENUITEM 'Clear Text_1 ReadOnly' ACTION Form_1.Text_1.ReadOnly := .F.
			SEPARATOR
				MENUITEM 'Get Text_1 Value' ACTION MsgInfo ( dtoc ( Form_1.Text_1.Value ) )
				MENUITEM 'Get Text_2 Value' ACTION MsgInfo ( dtoc ( Form_1.Text_2.Value ) ) 
				MENUITEM 'Get Text_3 Value' ACTION MsgInfo ( dtoc ( Form_1.Text_3.Value ) )
			END POPUP
		END MENU

		@ 10,10 TEXTBOX Text_1 ;
			VALUE ctod('01/01/2004') ;
			TOOLTIP 'Date'+CRLF+'TextBox 1' ;
			DATE

		@ 40,10 TEXTBOX Text_2 ;
			VALUE Date() ;
			TOOLTIP 'Date'+CRLF+'TextBox 2' ;
			DATE

		DEFINE TEXTBOX Text_3
			ROW 70
			COL 10
			DATE .T.
		END TEXTBOX

	END WINDOW
    SendMessage( GetFormToolTipHandle ("Form_1"), TTM_SETMAXTIPWIDTH, 0, 168)
	Form_1.Center

	Form_1.Activate

Return Nil
Last edited by Pablo César on Wed Sep 07, 2016 2:48 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Tooltip with multiline

Post by danielmaximiliano »

Gracias a emzampi vi el mensaje que me habia dejado Claudio :shock:
nunca lo vi
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: Tooltip with multiline

Post by andyglezl »

Pablo César wrote: by Pablo César » Wed Sep 07, 2016 7:34 am
Hi all and ciao Emanuele,

Are you trying with:

#define TTM_SETMAXTIPWIDTH 0x0418

...
END WINDOW
SendMessage( GetFormToolTipHandle ("Form_1"), TTM_SETMAXTIPWIDTH, 0, 168)

and CRLF in ToolTips ?
emzampi wrote:Have any of you like to try the example C: \ hmg.3.4.3 \ SAMPLES \ Controls \ TextBox \ TEXTBOX_2
For me it is working properly.
Estás de nuevo con nosotros Pablo Cesar ? Si es así, bienvenido de nuevo !.
(o es un post antiguo que se coló por aquí)
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply