CAppDialog Hidden Buttons Are Active

 

I've attatched a video of what is happening in my app.  A couple issues.


1) The button on the Main Tab you can only click on the left side... This was weird.. However, then I realized it was being masked by the "Edit" entry on another tab.  

2) Likewise when your on the other tab, the left of the button can still be clicked when it is hidden!


Watch this video to see the odd behavior I'm talking about https://www.screencast.com/t/ojzwEQPenD


My code is rather simple honestly.. My buttons are created like so...

CreateButton(m_BtnMainCloseShorts, "m_KMT_BtnMainCloseShorts"
             ,tab_button_start + tab_button_width*2 + tab_button_spacing*2
             , y
             ,tab_button_start + tab_button_width * 3 + tab_button_spacing *3
             , y+element_height
             , "Close Shorts");
TabMainObjects.Add(m_BtnMainCloseShorts);

bool KGUI::CreateButton(CButton &Btn, string name, int x1, int y1, int x2, int y2, string text, string tooltip = "\n" )
{
  if (!Btn.Create(m_chart_id, m_name + name, m_subwin, x1, y1, x2, y2))
    return false;
  if (!Add(Btn))
    return false;
  if (!Btn.Text(text))
    return false;

  ObjectSetString(m_chart_id, m_name + name, OBJPROP_TOOLTIP, tooltip);

  return true;
}



I'm Showing & hiding things from one panel like this 




// // Show Long Order Tab // void KGUI::ShowLongTab(void) { int totalObjects = TabLongObjects.Size(); HideMainTab(); HideShortTab(); for(int i = 0; i < totalObjects; i++ ) TabLongObjects.Element[i].Show(); Height(TabLongObjects.height); }

void KGUI::HideMainTab(void) {   int totalObjects = TabMainObjects.Size();   for(int i = 0; i < totalObjects; i++ )     TabMainObjects.Element[i].Hide(); }



Any clues would be greatly appreciated!  Thanks

11.17.2021-23.26.50
11.17.2021-23.26.50
  • www.screencast.com
Shared from Screencast.com
 

I'd need more code in order to find the error...


void KGUI::ShowLongTab(void)
{
  int totalObjects = TabLongObjects.Size();

  HideMainTab();
  HideShortTab();

  for(int i = 0; i < totalObjects; i++ )
    TabLongObjects.Element[i].Show();
  Height(TabLongObjects.height);
}

Maybe it's this:

If you have multiple buttons of the order buttons (buy stop etc) you need to check, wich one should be displayed and then hide the other order buttons.

Because from what I can tell at the moment you display every button the moment you open the main tab.

Or do you have one button and just change the text?

 
Lukas Roth #:

I'd need more code in order to find the error...


Maybe it's this:

If you have multiple buttons of the order buttons (buy stop etc) you need to check, wich one should be displayed and then hide the other order buttons.

Because from what I can tell at the moment you display every button the moment you open the main tab.

Or do you have one button and just change the text?

It is just one button where the text changes each time you click it.  I've tried playing with z orders.. But again, it doesn't matter as controls are active when its hidden is the real issue.  Same with the lower buttons to lay grid that do not overlap anywhere.  You can click Lay Grid when its outside the window & hidden.