Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizable columns #154

Closed
emoon opened this issue Mar 7, 2015 · 6 comments
Closed

Resizable columns #154

emoon opened this issue Mar 7, 2015 · 6 comments

Comments

@emoon
Copy link
Contributor

emoon commented Mar 7, 2015

Hi,

I wonder if it's possible to support resizable columns (that the user can drag with the mouse) ? Looking at the header file there are these 3 functions that seems related to it but has no comment and I haven't looked at the code yet on what they actually do:

IMGUI_API float         GetColumnOffset(int column_index = -1);
IMGUI_API void          SetColumnOffset(int column_index, float offset);
IMGUI_API float         GetColumnWidth(int column_index = -1);
@ocornut
Copy link
Owner

ocornut commented Mar 7, 2015

Columns are resizeable by default with the mouse, if you click on the column line it should work :)

Those API above allows you to set the position of the column from the left-side of the window, if you want to programmatically resize them, 'offset' is in pixels (I'll add that as a comment).

The column API #125 still have major limitations so it is trying to keep a little under the radar at the moment. The two main things that are missing are

  • Being able to set the default column position and a general sizing policy.
  • Have proper column headers (clickable, excluded from scrolling region, etc.)

@emoon
Copy link
Contributor Author

emoon commented Mar 7, 2015

Ah it actually do work 👍 :)

Then I guess something that would be is to optionally being able to change the mouse cursor on such events (Allowing the user to register callbacks should be good enough and when a sizing event call the callback with HorizontalResize/VerticalResize and such)

I do something similar for this in ProDBG for resizing of the docking windows (which happens outside ImGui)

Here is the Mac impl:

https://github.com/emoon/ProDBG/blob/master/src/prodbg/ui/mac/cursor_mac.mm

@ocornut
Copy link
Owner

ocornut commented Mar 7, 2015

Oh I suppose because you have a custom theme it didn't light up the column in a different color when hovering?

Good idea on the cursors, will add a new bug # for that.

@emoon
Copy link
Contributor Author

emoon commented Mar 7, 2015

Correct. I had fiddled around a bit too much with it so I didn't see the highlight :) I have fixed this locally now and can see it.

The cursor thing isn't very high priority but should hopefully be fairly easy to add and its much more natural to resize with a resize cursor as one is used to it.

@ocornut
Copy link
Owner

ocornut commented Mar 7, 2015

Closing this and opened #155 for the mouse cursors.
The styling system isn't very good at the moment, it's too hard to get a style done unless you focus on 2-3 colors. But that's low priority.

@ocornut ocornut closed this as completed Mar 7, 2015
@emoon
Copy link
Contributor Author

emoon commented Mar 7, 2015

Agreed. Not such a big deal and thanks for #155 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants