-
Notifications
You must be signed in to change notification settings - Fork 105
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
Improved the Add and R Help buttons with scrollbar on the General Graphic Dialog #8673
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@N-thony very nice. I am also happy with the size, but just wondered if a bit longer may be even better?
But then they stopped working, which makes me wonder about the code? I used it twice for the geoms and was pleased it also remembered its place in the list. Then I went to the R-help and that worked fine. Then back to the geom and then the second time, the help drop-down didn't work.
From then on neither down arrow works. Nothing happens. I tried reset, different data frame, closing the dialog. I have to start R-Instat again for them to now work again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@N-thony in the geoms the order is odd and some are repeated. They are ok and alphabetical in the long version:
I can't though get it to stop working so that seems well fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rdstern is it functionally correct to allow multiple additions of the same geom? Or should we enforce a single addition? |
@N-thony why did you choose to add a list box to the split button instead of just making the split button context menu scrollable? |
@Patowhiz yes you can have the same geom multiple times. This could be for the same layer, but the more common examples are when you plot, say tmax and tmin against date. You start with tmax against date, say with geom_line and then again for tmin. |
@Patowhiz I have done the investigation on this and did not find a possible way to make a context menu scrollable. You can have a look of different forms like here and here and you will see this one of the alternative as there is no way to make it scrollable |
So @Patowhiz can this now be accepted and merged? I am keen to proceed well, but also quickly - so not striving for perfection if what is here is ok. |
@rdstern and @N-thony thanks for your feedbacks. @rdstern, the focus here isn't on achieving perfection but rather on minimizing the set of alternative functions within the control. Introducing two ways of accomplishing the same task, when one suffices, adds unnecessary complexity and hinders future developer agility. While having multiple approaches can be justified in certain scenarios, in this case, it seems unwarranted. Note, this feature is currently needed in one place, in future we will most likely use it differently places, leading to different ways of using the same control. One way that uses the context menu, another way that uses a list box. One way that allows a developer to use the visual studio designer, another way that requires the developer to use the controller code file. Introducing unnecessary diversity in approaches often leads to bugs, as maintaining multiple ways of achieving the same outcome becomes a challenge. Therefore, my recommendation is to default to extending an existing method, promoting consistency and minimizing potential issues down the line. @N-thony trying adding the context menu inside a panel then make the panel scrollable. Then you can modify the existing code that shows and hides the context menu to show and hide the panel. This will ensure no external changes are needed by dialogs that use this control. They will always just use the context menu. If you find this difficult to do just let me know, considering @rdstern urgency to have this merged, I will merge this and later do the PR using the approach. Below is a sample code how I would have put the context menu inside a scrollable line. Then the panel could be shown or hidden in a similar way you have done with the list box.
|
@rdstern I have the change for the Add and R Help in the General Graph since both have long list and not display nicely for users.
![image](https://private-user-images.githubusercontent.com/68591383/286925407-4f39b329-11a5-4680-a035-f0f7df0388cf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODMwODUsIm5iZiI6MTczOTQ4Mjc4NSwicGF0aCI6Ii82ODU5MTM4My8yODY5MjU0MDctNGYzOWIzMjktMTFhNS00NjgwLWEwMzUtZjBmN2RmMDM4OGNmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIxMzk0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVhMzdhMDJlMmFlYjczZDY3ZGZiMmQyMzUxYmVmOWI0ZTM1OTU3OGJhZTY0MzFiY2U5YjkxMGI4NTEzY2ViMzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.A8dyUj7vfiP0UYvDLI-o75ANdbqjrnTR6xjBhzrED2c)
![image](https://private-user-images.githubusercontent.com/68591383/286925453-a2da7f9f-e4c5-4aa5-a30a-4a3586b85540.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODMwODUsIm5iZiI6MTczOTQ4Mjc4NSwicGF0aCI6Ii82ODU5MTM4My8yODY5MjU0NTMtYTJkYTdmOWYtZTRjNS00YWE1LWEzMGEtNGEzNTg2Yjg1NTQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIxMzk0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFmOTQyNzRiYTUzZTJiNjNhY2QyNWI5Y2VkOTk3NjY5Mzc2YzA1NzZiMzkzNzczNDAzZmZjYzhjZDAyMzJmY2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vrBuwZ8fz8miRVVYIIzN0ue5VB6OTfbTdxZr4JmdBew)
now they are using a scrollbar, have a look
![image](https://private-user-images.githubusercontent.com/68591383/286926014-6dcb45ed-e1b6-4b1f-913f-34460e18af9d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0ODMwODUsIm5iZiI6MTczOTQ4Mjc4NSwicGF0aCI6Ii82ODU5MTM4My8yODY5MjYwMTQtNmRjYjQ1Z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