Page 2 of 4

Re: ToolTip in IMAGE control

Posted: Wed Sep 04, 2013 7:55 am
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

ToolTip in IMAGE control

Posted: Wed Sep 04, 2013 12:29 pm
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 ...

Re: ToolTip in IMAGE control

Posted: Wed Sep 04, 2013 2:07 pm
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.

Re: ToolTip in IMAGE control

Posted: Thu Sep 05, 2013 12:44 am
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.

Re: ToolTip in IMAGE control

Posted: Thu Sep 05, 2013 5:52 am
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

Re: ToolTip in IMAGE control

Posted: Thu Sep 05, 2013 4:20 pm
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.

Re: Tooltip with multiline

Posted: Wed Sep 07, 2016 7:29 am
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

Tooltip with multiline

Posted: Wed Sep 07, 2016 2:34 pm
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

Re: Tooltip with multiline

Posted: Wed Sep 07, 2016 2:42 pm
by danielmaximiliano
Gracias a emzampi vi el mensaje que me habia dejado Claudio :shock:
nunca lo vi

Re: Tooltip with multiline

Posted: Wed Sep 07, 2016 3:24 pm
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í)