Normal Topic Adding a new button to Button Panel (Read 5796 times)
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Adding a new button to Button Panel
Mar 28th, 2021 at 5:36am
Print Post Print Post  
I am trying to provide a button to Find All Duplicate Records, but not Remove from results, or delete.  The Tree menu in Search Mode works well manually.  I have tried two other methods to do this, but they don't work.  Details are in an earlier posting for "Finding Duplicates".
This brought me to a third approach, but since it is more generic I thought it should have its own topic.  I am trying to add a Button onto the Button Panel, to Make the "All Duplicates Search" Tree selection.  Having no success.  Here is the code I am using to do this:
Code
Select All
#include "sbasic_include.sbas"

ButtonPanelItem(BUTTON_PANEL_ADD_ITEM, SEARCH_PANEL, "Show ALL Duplicates", "Search Menu!Search Commands!All Duplicates Search"
 


What is wrong with this code? I have tried to run it from a Command Button.  I have called the code when the form first opens.  I see no way to troubleshoot it, no return code.

My "sbasic_include.sbas" file is in C:\Sesame2\ folder, same folder as my Sesame.ini file. 

I thought about putting it in the Application Code, but would like to make these changes with code, vs. a semi-hardcoded Button Panel.

So, again, what am I doing wrong?  I never tried adding/deleting buttons here, but now that I know about it, seems like I need to really understand for other future purposes.

Thanks for listening.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Adding a new button to Button Panel
Reply #1 - Mar 29th, 2021 at 2:19pm
Print Post Print Post  
Hello,

You need to call
Code
Select All
ButtonPanel(1) 



to tell Sesame to use Button Panels. Also it is likely you'll need to call ForceRedraw() if the Menu Tree is already displayed. So your code in Global Code would look something like:

Code
Select All
#include "sbasic_include.sbas"

	ButtonPanelItem(BUTTON_PANEL_ADD_ITEM, SEARCH_PANEL, "Show ALL Duplicates", "Search Menu!Search Commands!All Duplicates Search")
        ButtonPanel(1)
	ForceRedraw() 



-Ray

  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
obfusc88
Full Member
***
Offline


No personal text

Posts: 194
Joined: Dec 17th, 2005
Re: Adding a new button to Button Panel
Reply #2 - Mar 29th, 2021 at 6:01pm
Print Post Print Post  
Aha!.  Totally different from what I expected.  I thought the new Button would be added to the normal existing Buttons.  But now I see that this Builds a complete panel of buttons that I want. Now I recall why I ws toggling the Show Tree/Button buttons. I was just trying to add a single Button to Find Duplicates. 

No longer need to do this because your fixed the original problem.  But now I see a whole new box of tools.

Thanks again, Ray, stay safe.
  
Back to top
 
IP Logged