×

Notice

The forum is in read only mode.

DEVO10 UI

More
05 Jan 2013 11:33 #4691 by suvsuv
Replied by suvsuv on topic DEVO10 UI

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 :sick: ) .
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 ?

I just gave you a sample codes showing how to implement what you want in devo10, instead of providing you production codes.
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
More
05 Jan 2013 12:54 #4692 by domcars0
Replied by domcars0 on topic DEVO10 UI
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.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
More
05 Jan 2013 13:25 #4694 by suvsuv
Replied by suvsuv on topic DEVO10 UI

domcars0 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.

_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 devo10
More
05 Jan 2013 15:06 #4698 by quique65
Replied by quique65 on topic DEVO10 UI
Hi,
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.
More
05 Jan 2013 17:28 #4702 by PhracturedBlue
Replied by PhracturedBlue on topic DEVO10 UI
At the moment I am focused on other tasks, and enhancing the GUI is not at the top of my todo list. I will be happy to include (properly implemented) enhancements though (perhaps not immediately, my current repo is in disarray due to the devo7e work).
More
01 Jan 2014 10:29 #17624 by kreidler
Replied by kreidler on topic DEVO10 UI reordering mixer
I just put this thread on the top again to recall what has been done already.

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.
Time to create page: 0.422 seconds
Powered by Kunena Forum