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

New Suggestions After More Experimenting #26

Open
3 of 5 tasks
Wajinn opened this issue Aug 11, 2023 · 4 comments
Open
3 of 5 tasks

New Suggestions After More Experimenting #26

Wajinn opened this issue Aug 11, 2023 · 4 comments

Comments

@Wajinn
Copy link

Wajinn commented Aug 11, 2023

Based on more experiments with creating different kinds of GUIs, the following came up and hopefully can be fixed/added:

  • Table and List widget need text_align/"tAlin" to be adjustable, not just fixed to the center.

You can have text in the array that are of different lengths, and it can look better if moved to the left or right.

  • Group widget needs adjustable font size.

The text can be too big for the GUI and other widgets.

  • Hyperlink widget needs adjustable font size too.

  • Textarea and Textbox need multiline and word_wrap?

It appears that V UI has this option. Without these features, long lines of text need to be controlled by manual returns and they don't adjust to the size of the GUI when resized.

  • Button needs both click (fnclk) and unclick (fnucl) options.

This is because a user may want to do things like have the button color or background change when pressed down or do various other things until or when unclicked.

@malisipi
Copy link
Owner

5 is done.
However i recommend to don't trust unonclick event. It will not be triggered with keyboard. To avoid accessibility issues, i recommend checking the event_details.triggerer firstly. If it's keyboard, you can avoid applying custom styles or trigger unclick function manually.

import malisipi.mui as m
import gx
fn change_color(event_details m.EventDetails, mut app &m.Window, mut app_data voidptr){
unsafe {
if event_details.trigger == "keyboard" { return }
app.get_object_by_id(event_details.target_id)[0]["bg"].clr = gx.Color {r: 255, g:0, b:0}
}
}
fn set_original_color(event_details m.EventDetails, mut app &m.Window, mut app_data voidptr){
unsafe {
app.get_object_by_id(event_details.target_id)[0]["bg"].clr = app.color_scheme[1]
}
}
mut app:=m.create(title: "Changing background of Button", width: 290, height: 120)
app.button(id:"button", x: 20, y:20, width: 250 text:"I'mma button" onclick: change_color, onunclick: set_original_color)
app.button(id:"button2", x: 20, y:80, width: 250 text:"I'mma second button" onclick: change_color, onunclick: set_original_color)
app.run()

Also i'm sorry about the delay. I haven't much time to improve this library by university entrance exam.

@malisipi
Copy link
Owner

I will implement 1, 2 and 3 asap.

Also I want to implement 4. However 4 is too complex to implement with limited time. If i have free time, i will implement it.

@Wajinn
Copy link
Author

Wajinn commented Sep 4, 2023

I will implement 1, 2 and 3 asap.

Good to see your consideration and continual efforts (like the draggable frame).

The changes to 1 (table and list), 2 (group), 3 (hyperlink/link), and their corresponding functions in widget.v would be best for greater usability of MUI. Presently, certain GUIs look odd, without such changes being implemented.

Also I want to implement 4. However 4 is too complex to implement with limited time. If i have free time, i will implement it.

This one is not too much of an issue, unlike the others, as can work around it. I guess it would be something nice for the future.

5 is done.

Yes, this one is working. And the extra info and example is good too.

@malisipi
Copy link
Owner

malisipi commented Sep 6, 2023

2 and 3 is supported by 619aa7c commit .

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

No branches or pull requests

2 participants