-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Issues #17
Comments
Hey, |
I've literally just copied and pasted your win32 example into the MinGW compiler. in reference to number 4. |
Ah OK, that makes sense I just saw that I forgot to update win32 input handling to this library version. So it shouldn't be to much trouble to fix the problem. |
Oh cool! Do you think you could quickly show me what the fix is before you push it live? |
OK I fixed the backspace and key behavior. The problem was that I checked the wrong parameter in win32's MSG struct in the key function. I checked |
I can confirm everything is working now! Have you looked into the scroll bar issue? |
I looked at the scrollbar problem and things got a little bit more complicated. The reason why the scrollbar behaves like it does is because I don't want to store another flag with each scrollbar. Since each window and more importantly subwindows (popups, groups, shelfs ...) would all need another variable that needs to be stored by the user. This is generally a problem with dragging in my library which would have to be based on permanent dragging state. But in general up to this point I never had problems with scrolling, especially since you can still scroll by mouse (at least in windows). In general there are some more cases in this library with this kind of problem for example text that spans over the editbox bounds uses frames instead of scrolling to move to the left and a few other smaller cases which are hard to handle since everything can change and almost no state is stored. There would be a solution to fix and get all this and other things that bother me with this library right but it would require to rewrite everything (2-4kLoc) except the base (buffer, commands, vertex buffer, font handling, editbuffer). In general I would have no problem doing exactly that but I would have to totally rewrite and change the API, a lot of really hard to get right parts of the library like window and all subwindow handling and explore and iterate a lot. While even all that would not really bother me the fact that I worked on it for 7-10 month does, at least at the moment I just want to fix bugs that come up and learn and explore other things. I will probably come back in the future and fork this library and try to do all that but at the moment I am just tired of all these complete rewrites. |
That's completely understandable. You did a great job! Thanks a lot! I'll try to promote Zahnrad everywhere, where possible, because I see a great opportunity in the future (be it Zahnrad, or rather the new fork with the mentioned issues solved). |
OK I found a solution (more like a hack) to fix the the scrollbar behavior. I use the input structure to update the clicked position with the cursor movement which works nicely and as so far no downside the user input behavior. Biggest downside is of course that I have to remove const correctness for the input struct inside the context/window but I think it is worth it. |
Hey! Thanks as always for fixing these issues so quickly. I've got a few more for you.
scroll.w = scroll.w;
scroll.x = scroll.x;
Were you trying to do something else?
define LEN(a) (sizeof(a)/sizeof(a)[0])
define UNUSED(a) ((void)(a))
include <stdarg.h>
include "zahnrad.h"
void clipboard_set(const char text){UNUSED(text);}
zr_bool clipboard_is_filled(void){return zr_false;}
const char clipboard_get(void) {return NULL;}
I've found it doesn't compile without this (at least on Windows).
bool flag = false;
if (mouse.clicked_on_Scrollbar()) { flag = true; }
if (flag && mouse.unclicked) { flag = false; }
if (flag) {
//scroll scroll bar distance mouse has moved in the y direction regardless of x
scrollbar.scroll(mouse.prev_x - mouse.curr_x);
}
Anyways thanks for reading and I look forward to an update!
The text was updated successfully, but these errors were encountered: