- Posts: 268
DEVO10 UI
- suvsuv
- Offline
I just gave you a sample codes showing how to implement what you want in devo10, instead of providing you production codes.domcars0 wrote: 1) OK now I understand better how the buttons works (but the logic seems different in the Devo 8 (PB) implementation
2) I agree that implement a specific hilite for the Image widget is not good
as it can not clear unselected images, but when you implement it in the gui/image.c, this change how the Devo8 images are highlited (look how icons are now highlited in the Devo8 toggle icons page.. not sure that Devo8 developpers will agree ) .
I think that implementation of how are highlited images in gui/128x64x1/_gui.c function _gui_hilite_selected() is not completly crazy, but it miss may be a
function for unselected items ?
To address your question, you have 2 solutions:
#1: create 2 files, naming _image.c, under both gui/128x64x1 and gui/320x240x16.
Then you can create _draw_image separately for devo10 and devo8, and change GUI_DrawImage() as below:
// below codes in gui/image.c
void GUI_DrawImage(struct guiObject *obj)
{
_draw_image(obj);
}
// below codes in gui/320x240x16/_image.c
void _draw_image(struct guiObject *obj)
{
struct guiImage *image = &obj->o.image;
struct guiBox *box = &obj->box;
LCD_DrawWindowedImageFromFile(box->x, box->y,
image->file, box->width, box->height,
image->x_off, image->y_off);
}
// below codes in gui/128x64x1/_image.c
void _draw_image(struct guiObject *obj)
{
struct guiBox *box = &obj->box;
// 1st need to clear the whole widget, including its selected border
GUI_DrawBackground(box->x -1, box->y-1, box->width +2, box->height +2);
LCD_DrawWindowedImageFromFile(box->x, box->y,
image->file, box->width, box->height,
image->x_off, image->y_off);
if (GUI_GetSelected() == obj)
LCD_DrawRect(box->x -1, box->y-1, box->width +2, box->height +2, 1);
}
#2: introduce a type inside the guiImage structure to distinguish between devo10 and devo8. Then you can do whatever you want for devo10 by checking the image->type. Of coz you have to create new creation method of GUI_CreateImageOffsetDevo10(), similar to what is done in button.c
Please Log in or Create an account to join the conversation.
- domcars0
- Offline
- Posts: 390
Thank you for your patience and your precious help!
I agree with your new proposition code, but I think it breaks the "_gui_hilite_selected()" idea ....
I prefer to introduce a new _gui_hilite_unselected() function in gui/<specific>/_gui.c
Take a look in my repository and feel free to take this small part of code.
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- suvsuv
- Offline
- Posts: 268
_gui_hilite_selected is only valid for devo8 as it has uniform selected/unselected behavior. In devo10, the selected legend varies in different widgets, and even in the same widget with different type, so putting selected drawing in _gui_hilite_selected is not good in devo10. You can take a look at label.c then you will understand why _gui_hilite_selected is actually not used in devo10domcars0 wrote: Hi Suvsuv,
Thank you for your patience and your precious help!
I agree with your new proposition code, but I think it breaks the "_gui_hilite_selected()" idea ....
I prefer to introduce a new _gui_hilite_unselected() function in gui/<specific>/_gui.c
Take a look in my repository and feel free to take this small part of code.
Please Log in or Create an account to join the conversation.
- quique65
- Offline
- Posts: 45
in my opinion the domcars0 idea is a good functionality. suvsuv & PB, it will be great if you can include this code in your repo's.
Regards,
Enrique.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- kreidler
- Offline
- Posts: 157
While going through the new 4.0.0 Devo8 manual I found the section 8.2.1 Channel Reorder which is not avaiable on the Devo10/7e. Some files are available in the source already but I am not a programmer:).
Could anyone have a look after this feature. When building complex setup this function would be a great help.
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- DEVO10 UI