Tooltip with multiline

Moderator: Rathinagiri

User avatar
esgici
Posts: 4516
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Re: ToolTip in IMAGE control

Post by esgici » Wed Sep 04, 2013 7:55 am

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
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Wed Sep 04, 2013 12:29 pm

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
Location: Araruama-RJ, Brazil

Post by Amarante » Wed Sep 04, 2013 2:07 pm

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: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Thu Sep 05, 2013 12:44 am

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: 4516
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 389 times
Been thanked: 111 times
Contact:

Post by esgici » Thu Sep 05, 2013 5:52 am

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: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Thu Sep 05, 2013 4:20 pm

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: 79
Joined: Sun Aug 11, 2013 9:00 am
Has thanked: 1 time

Post by emzampi » Wed Sep 07, 2016 7:29 am

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
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Wed Sep 07, 2016 2:34 pm

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: 2153
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 162 times
Been thanked: 26 times
Contact:

Post by danielmaximiliano » Wed Sep 07, 2016 2:42 pm

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

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
andyglezl
Posts: 1161
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 35 times
Been thanked: 73 times
Contact:

Post by andyglezl » Wed Sep 07, 2016 3:24 pm

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