Hi Thorsten,
first, thanks for this great module.
Sorry, but I have a little problem to use it in my program with ImageButtons.
I wrote a procedure to set the different Fonts using in the ToolTip:
Code: Select all
Procedure CreateTT_Mess_Fonts()
LoadFont(#MyFont_Normal, "Arial", 9, #PB_Font_HighQuality)
LoadFont(#MyFont_Bold, "Arial", 9, #PB_Font_Bold)
LoadFont(#MyFont_BoldItalic, "Arial", 10, #PB_Font_Bold | #PB_Font_Italic)
LoadFont(#MyFont_BoldUnderline, "Arial", 9, #PB_Font_Bold | #PB_Font_Underline)
LoadFont(#MyFont_BoldItalicUnderline, "Arial", 9, #PB_Font_Bold | #PB_Font_Italic | #PB_Font_Underline)
EndProcedure
I wrote a procedure to create a ToolTip:
Code: Select all
Procedure MakeToolTip(ForGadget.i, ForWindow.i, TT_Image.i, TT_Text.s, TT_Title.s)
If ToolTip::Create(ForGadget, ForWindow)
ToolTip::SetContent(ForGadget, TT_Text, TT_Title)
ToolTip::SetFont(ForGadget, #MyFont_BoldItalic, ToolTip::#Title)
ToolTip::SetColor(ForGadget, ToolTip::#BorderColor, $800000)
ToolTip::SetColor(ForGadget, ToolTip::#BackColor, $FFFFFA)
ToolTip::SetColor(ForGadget, ToolTip::#TitleBorderColor, $800000)
ToolTip::SetColor(ForGadget, ToolTip::#TitleBackColor, $B48246)
ToolTip::SetColor(ForGadget, ToolTip::#TitleColor, $FFFFFF)
ToolTip::SetFont(ForGadget, #MyFont_Normal, ToolTip::#Text)
If TT_Image > 0
ToolTip::SetImage(ForGadget, TT_Image, #PB_Default, #PB_Default, ToolTip::#Border)
EndIf
EndIf
EndProcedure
I wrote a procedure to create all ToolTips for all gadgets:
Code: Select all
Procedure MakeAllToolTips()
; MainWindow
MakeToolTip(ButtonImage_OpenDesign, Window_Main, 0, "Load a design as base for a diagonal crossstitch-design.", "Load design")
MakeToolTip(ButtonImage_Big_Cross, Window_Main, 0, "Select crossstich-size." + #DoubleLF$ + "This is a 9 point crossstitch.", "Big cross-stitch")
MakeToolTip(ButtonImage_Small_Cross, Window_Main, 0, "Select crossstich-size." + #DoubleLF$ + "This is a 6 point crossstitch.", "Small cross-stitch")
MakeToolTip(ButtonImage_LongFloatBindings,Window_Main, 0, "Add longfloating and flat bindings to crossstitch-design.", "Add binding points")
MakeToolTip(ButtonImage_Palette, Window_Main, 0, "Organize color-palette in crosstitch-design.", "Organize palette")
MakeToolTip(ButtonImage_Save, Window_Main, 0,"Save crossstitch-design.", "Save")
MakeToolTip(ButtonImage_Print, Window_Main, 0, "Print cross-stitch-design.", "Print")
MakeToolTip(ButtonImage_Exit, Window_Main, 0, "Exit program.", "Exit")
MakeToolTip(Image_OutlineColor, Window_Main, 0, "Right-click here to select color for the outline." + #DoubleLF$ + "Selected color must be totally different from any color" + #LF$ + "used in the design and taped-hem-color!" + #DoubleLF$ + "Left-double-click to use default-color!", "Outline-color")
MakeToolTip(Image_TapedHemColor, Window_Main, 0, "Right-click here to select color for the taped-hem." + #DoubleLF$ + "Selected color must be totally different from any color" + #LF$ + "used in the design and from outline-color!" + #DoubleLF$ + "Left-double-click to use default-color!", "Taped-hem-color")
MakeToolTip(Spin_TapedHemWidth, Window_Main, 0, "Setup the width for the taped-hem." + #DoubleLF$ + "Width can be between 20 and 40 pixels.", "Taped-hem-width")
MakeToolTip(ScrollArea_OriginalDesign,Window_Main, 0, "The original-Design will be shown here." + #LF$ + "The selected zoomfactor is used.", "Original design")
MakeToolTip(ScrollArea_CrossStitch, Window_Main, 0, "In this area the cross-stitch-design will be shown," + #LF$ + "using the selected zoomfactor.", "Cross-stitch-design")
MakeToolTip(TrackBar_Zoom, Window_Main, 0, "Select zoomfactor for original-design and cross-stitch-design.", "Zoom")
; Palette
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
; MakeToolTip(ForGadget.i, ForWindow.i, 0, "", "")
EndProcedure
The eventLoop for all gadgets / ImageButtons is:
Code: Select all
Procedure Window_Main_Events(Event)
Select Event
Case #PB_Event_SizeWindow
ResizeGadgetsWindow_Main()
Case #PB_Event_CloseWindow
ProcedureReturn #True
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case ButtonImage_OpenDesign
ButtonImage_OpenDesign()
Case ButtonImage_Big_Cross
ButtonImage_Big_Cross()
Case ButtonImage_Small_Cross
ButtonImage_Small_Cross()
Case ButtonImage_LongFloatBindings
ButtonImage_LongFloatBindings()
Case ButtonImage_Save
ButtonImage_Save()
Case ButtonImage_Palette
ButtonImage_Palette()
Case ButtonImage_Print
ButtonImage_Print()
Case TrackBar_Zoom
CrossStitchDesign_Zoom_TrackBar()
Case Image_OutlineColor
If EventType() = #PB_EventType_RightClick
Image_OutlineColor()
ElseIf EventType() = #PB_EventType_LeftDoubleClick
Image_OutlineColorDefault()
EndIf
Case Image_TapedHemColor
If EventType() = #PB_EventType_RightClick
Image_TapedHemColor()
ElseIf EventType() = #PB_EventType_LeftDoubleClick
Image_TapedHemColorDefault()
EndIf
Case ButtonImage_Exit
ButtonImage_Exit()
ProcedureReturn #True
EndSelect
EndSelect
ProcedureReturn #False
EndProcedure
All this works well when using the ToolTips with an Image, ScrollArea, SpinEdit. But using this ToolTips with an ImageButton it does not work as aspected. Moving the mouse over the ImageButton the ToolTip will not be shown, instead of this the button will be clicked (avtivated) directly 2 times only when hoovered by the mouse!
I searched and tried a lot, but I did not find the mistake.
Thanks in advance for your help and
regards
Rainer