Author Topic: [solved]debugger pop-up doesn't fit on screen  (Read 1360 times)

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
[solved]debugger pop-up doesn't fit on screen
« on: July 21, 2017, 04:53:37 pm »
Look how it's displayed, not all vertical space is used, pop-up goes beyond the screen border:



I updated to nightbuilds, and scrollbar is gone too.
« Last Edit: July 29, 2017, 06:31:22 pm by visir »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5988
    • My Best Post
Re: debugger pop-up doesn't fit on screen
« Reply #1 on: July 21, 2017, 09:17:53 pm »
What Operating System? Name and version.
If Linux, what desktop? KDE, Unity, and etc.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #2 on: July 21, 2017, 09:24:06 pm »
Windows 7

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #3 on: July 22, 2017, 02:08:31 pm »
I downloaded source code, where is the code for this pop-up?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10398
Re: debugger pop-up doesn't fit on screen
« Reply #4 on: July 22, 2017, 02:09:40 pm »
watchesdlg.cpp
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #5 on: July 28, 2017, 12:47:58 pm »
pop-up is ValueTooltip in watchesdlg.cpp, correct?

Tried to place a breakpoint on ValueTooltip::ValueTooltip, doesn't seem to work. Don't know if I'm in debug or release mode, target just says "all". (It should have debug info, it's in the devel folder)

Where is the main() function?
« Last Edit: July 28, 2017, 12:59:57 pm by visir »

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #6 on: July 28, 2017, 01:51:06 pm »
This bit looks interesting.

void ValueTooltip::Fit()
{
    ::SetMinSize(m_grid);
    m_sizer->Fit(m_panel);
    wxPoint pos = GetScreenPosition();
    wxSize size = m_panel->GetScreenRect().GetSize();
    SetSize(pos.x, pos.y, size.x, size.y);
}

Can't really do anything with it till I figure out why breakpoints don't work.

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #7 on: July 28, 2017, 02:22:20 pm »
Tried setting breakpoint on main.cpp/MainFrame::MainFrame(). Doesn't work. It works with other apps, but not when I try to debug codeblocks with codeblocks. I'm opening one in "devel" folder with one in "output" folder, so it should work.

Also I changed     SetSize(pos.x, pos.y, size.x, size.y); to     SetSize(pos.x, 0, size.x, size.y);, nothing changed either.

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1581
Re: debugger pop-up doesn't fit on screen
« Reply #8 on: July 28, 2017, 04:35:16 pm »
Have you build codeblocks with debug symbols enabled?
You have to set the global variable "cb" to "-g"

Also, if you change something in a plugin you have to test it trough codeblocks or run the update script again, so all plugins get copied again

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #9 on: July 28, 2017, 04:39:56 pm »
No, I didn't set it. Thank you for telling this.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5988
    • My Best Post
Re: debugger pop-up doesn't fit on screen
« Reply #10 on: July 28, 2017, 06:45:55 pm »
Have you build codeblocks with debug symbols enabled?
You have to set the global variable "cb" to "-g"

Also, if you change something in a plugin you have to test it trough codeblocks or run the update script again, so all plugins get copied again

Correction: You have to set the global variable "cb_release_type" to "-g".

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: debugger pop-up doesn't fit on screen
« Reply #11 on: July 29, 2017, 06:30:04 pm »
Okay, I sort of fixed it.

everything is in src/watchesdlg.cpp

ValueTooltip::Fit now looks like this:

void ValueTooltip::Fit()
{
    ::SetMinSize(m_grid);
    m_sizer->Fit(m_panel);
    wxPoint pos = GetScreenPosition();
    //wxSize size = m_panel->GetScreenRect().GetSize();
    wxSize size = m_grid->GetScreenRect().GetSize();
    //SetSize(pos.x, pos.y, size.x, size.y);

    int max_y = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, m_grid->GetParent() );

    int y = pos.y;
    if (y + size.y > max_y) {
        y = max_y - size.y;
    }

    //SetSize(pos.x, 0, size.x, size.y);
    //SetSize(pos.x, 0, size.x, max_y);
    SetSize(pos.x, y, size.x, size.y);
}

In ValueTooltip::OnTimer, added Fit(); at the very end.

In SetMinSize, replaced this:

    int minWidth = (wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent())*3)/2;
    int minHeight = (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent())*3)/2;

with this:

    int minWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent()); //changed
    int minHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent());

It now uses all of the screen. It probably goes under menu bar, but it's hidden for me anyway.

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: [solved]debugger pop-up doesn't fit on screen
« Reply #12 on: July 29, 2017, 06:36:48 pm »
Here are some structures if you want to check how this works.

typedef struct client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
    int a1;
    int b1;
    int c1;
    int d1;
    int e1;
    int f1;
    int g1;
    int h1;
    int i1;
    int k1;
    int l1;
    int m1;
    int n1;
    int o1;
    int p1;
    int q1;
    int r1;
    int s1;
    int t1;
    int u1;
    int v1;
    int w1;
    int x1;
    int y1;
    int z1;
        int a2;
    int b2;
    int c2;
    int d2;
    int e2;
    int f2;
    int g2;
    int h2;
    int i2;
    int k2;
    int l2;
    int m2;
    int n2;
    int o2;
    int p2;
    int q2;
    int r2;
    int s2;
    int t2;
    int u2;
    int v2;
    int w2;
    int x2;
    int y2;
    int z2;
        int a3;
    int b3;
    int c3;
    int d3;
    int e3;
    int f3;
    int g3;
    int h3;
    int i3;
    int k3;
    int l3;
    int m3;
    int n3;
    int o3;
    int p3;
    int q3;
    int r3;
    int s3;
    int t3;
    int u3;
    int v3;
    int w3;
    int x3;
    int y3;
    int z3;
        int a4;
    int b4;
    int c4;
    int d4;
    int e4;
    int f4;
    int g4;
    int h4;
    int i4;
    int k4;
    int l4;
    int m4;
    int n4;
    int o4;
    int p4;
    int q4;
    int r4;
    int s4;
    int t4;
    int u4;
    int v4;
    int w4;
    int x4;
    int y4;
    int z4;
}
client_static_t;

typedef struct small_client_static_s
{
    int a;
    int b;
    int c;
    int d;
    int e;
    int f;
    int g;
    int h;
    int i;
    int k;
    int l;
    int m;
    int n;
    int o;
    int p;
    int q;
    int r;
    int s;
    int t;
    int u;
    int v;
    int w;
    int x;
    int y;
    int z;
}
small_client_static_t;

client_static_t   cls;

small_client_static_t scls;

Offline visir

  • Multiple posting newcomer
  • *
  • Posts: 65
Re: [solved]debugger pop-up doesn't fit on screen
« Reply #13 on: July 29, 2017, 06:42:08 pm »
Ideally it should check window size instead of screen size. It's the same thing in my case though.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 10398
Re: [solved]debugger pop-up doesn't fit on screen
« Reply #14 on: July 29, 2017, 06:58:12 pm »
Please provide a patch which could be applied.
See here for details: http://wiki.codeblocks.org/index.php/Creating_a_patch_to_submit_(Patch_Tracker)

p.s. And please use code tags (the little # button) when posting log pastes...
<debugger plugin maintainer>
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]