It is currently Sat Jul 04, 2020 5:50 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Jul 11, 2019 1:52 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
Extended ToolTip - Gadget (all OS / 64Bit / DPI)

Thanks to the mk-soft code, ToolTips for gadgets other than the CanvasGadget can now also be displayed.

Improved tooltips for all gadgets.
  • multiline tooltips (#LF$)
  • optional title bar
  • possibility to define an area on the gadget
Code:
; ToolTip::Gadget()       - Add tooltip gadget
; ToolTip::SetAttribute() - similar to SetGadgetAttribute()
; ToolTip::SetColor()     - similar to SetGadgetColor()
; ToolTip::SetContent()   - set tooltip text & title and define tooltip area
; ToolTip::SetFont()      - similar to SetGadgetFont()
; ToolTip::SetState()     - activates/deactivates tooltip

Download: ToolTipExModule.pbi

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Last edited by Thorsten1867 on Sat Nov 23, 2019 3:15 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Sat Jul 13, 2019 1:58 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
Update: ToolTip is now a separate window and not just a gadget

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Sat Jul 20, 2019 10:36 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
Bugfixes

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Wed Nov 20, 2019 8:23 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 203
I made some tests with it.

If I close my program, it needs ~1-2 Seconds. I think, its the thread which pause the closing.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Wed Nov 20, 2019 3:05 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
I suppose so, too.

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Nov 21, 2019 8:27 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 23, 2014 1:18 pm
Posts: 203
Can't create a tooltip in a ContainerEx.
If I try, ContainerEx dies on line 532


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Nov 21, 2019 9:45 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
Please check if the problem is fixed.
Important: ToolTipEx must be defined outside the container.

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Mon Dec 23, 2019 9:14 am 
Offline
User
User
User avatar

Joined: Sat Aug 30, 2014 9:00 pm
Posts: 15
Location: Switzerland
PB 5.71 x64, TooltipExModule.pbi 08.12.2019

I see only the last created ToolTip in my example.

Code:
XIncludeFile "TooltipExModule.pbi"

OpenWindow(0, 50, 50, 600, 400, "Test")

SpinGadget(10,20,20,60,20,0,100,#PB_Spin_Numeric|#ES_RIGHT)
SetGadgetState(10,33)
ToolTip::Create(10,0)
ToolTip::SetContent(10,"ToolTip SpinGadget","")

CheckBoxGadget(20,20,50,100,20,"CheckBoxGadget")
ToolTip::Create(20,0)
ToolTip::SetContent(20,"ToolTip CheckBoxGadget","")

StringGadget(30,20,80,120,14,"Test")
GadgetToolTip(30,"StringGadget 30")

Repeat
  EventID = WaitWindowEvent(1)
Until EventID = #PB_Event_CloseWindow

CloseWindow(0)


I see only the tooltip of the CheckBoxGadget. The tooltip of the SpinGadget is not visible. Why ?


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Mon Dec 23, 2019 11:20 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
Bugfixes

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Mon Dec 23, 2019 1:16 pm 
Offline
User
User
User avatar

Joined: Sat Aug 30, 2014 9:00 pm
Posts: 15
Location: Switzerland
Thanks for the bugfix. My example-code works fine now.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Tue Mar 17, 2020 11:51 am 
Offline
User
User
User avatar

Joined: Fri Jun 07, 2019 1:56 pm
Posts: 77
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:
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:
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:
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:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Wed Mar 18, 2020 9:14 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
I'm afraid I need a simple code that will allow me to reproduce the problem.

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Mar 19, 2020 6:53 pm 
Offline
User
User
User avatar

Joined: Fri Jun 07, 2019 1:56 pm
Posts: 77
Thorsten1867 wrote:
I'm afraid I need a simple code that will allow me to reproduce the problem.


Hi Thorsten, where to send the sources?

Its about 1500 lines and som BMP's.

Regards Rainer


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Mar 19, 2020 7:05 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 24, 2005 4:02 pm
Posts: 1265
Location: Germany
You disabled responses on PM.

Gesendet von meinem Aquaris X2 mit Tapatalk

_________________
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 10 x64] [PB V5.7x]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Module] ToolTipEx - Module (all OS)
PostPosted: Thu Mar 19, 2020 11:05 pm 
Offline
User
User
User avatar

Joined: Fri Jun 07, 2019 1:56 pm
Posts: 77
Thorsten1867 wrote:
You disabled responses on PM.

Gesendet von meinem Aquaris X2 mit Tapatalk


Hi Thorsten, please send pm again. I have changed the settings.

Regards Rainer


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye