Jump to content

ForTest

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by ForTest

  1. Thanks Joel, the example made it clear Best regards
  2. Hello everyone! We are trying to open image files without using widgets but we are not clear how to do that We have been looking at these - https://wiki.ugfx.io/index.php/Images - https://wiki.ugfx.io/index.php/ROMFS We mapped our logo in .h format and included it inside the file "romfs_file.h" From here then it is not clear to us how to go forward. Can you give us any suggestions? Thank you
  3. It's a permanent offset. It should works for all widgets and in general for everything plotted on the display.
  4. I try to explain better. I want the display to add for example 10 px as offset to the Y axis, so if I tell it to plot at x:0 y:0 it actually plots it at x:0 y:10 The easiest thing to do is to modify all the gdisp routines and add this offset to the y component. I was wondering if anyone knew of a way to set the video controller at init already with this offset.
  5. Hi, is it possible to add an Y offset to the screen? I'm using SSD1963 Thanks
  6. Hi, actually i'm using uGFX 2.4 on a old project and i have a little problem with the font right alignment. The font comes from a monospaced ttf file, converted with the ugfx font converter. For example i have the two instructions: gdispFillStringBox(505, 115, 72, 20, text1, IsonormMonospacedRegular20, mycolor, mybgcolor, justifyRight); gdispFillStringBox(505, 267, 72, 20, text2, IsonormMonospacedRegular20, mycolor, mybgcolor, justifyRight); 'text1' and 'text2' contains different numbers (including "." and "-" characters) I expect that text1 and text2 digits are perfectly alligned but depending from the digit i have 1 pixel of difference. With justifyLeft i don't have this problem. I think the problem is only in the right alignment. IsonormMonospacedRegular20.c ufonts.com_isonorm-regular.ttf
  7. Hi This is a general question about graph interpolation that doesn't concern with the current features of uGFX (i hope these features will be added a day) Does anyone know some interpolation routine or library for graph that can be used in uGFX? I already know that uGFX connect points. I mean something like the figure. -Fabrizio-
  8. I'll give it a try Thank for suggestions
  9. I wrote my custom but it's very very slow void gwinButtonDraw_Rounded(GWidgetObject *gw, void *param) { const GColorSet * pcol; fixed alpha; fixed dalpha; coord_t i; color_t tcol, bcol; (void) param; if (gw->g.vmt != (gwinVMT *)&buttonVMT) return; pcol = getButtonColors(gw); /* Fill the box blended from variants of the fill color */ tcol = gdispBlendColor(White, pcol->fill, BTN_TOP_FADE); bcol = gdispBlendColor(Black, pcol->fill, BTN_BOTTOM_FADE); dalpha = FIXED(255)/gw->g.height; // Fade effect for(alpha = 0, i = 0; i < gw->g.height; i++, alpha += dalpha) gdispGDrawLine(gw->g.display, gw->g.x, gw->g.y+i, gw->g.x+gw->g.width-2, gw->g.y+i, gdispBlendColor(bcol, tcol, NONFIXED(alpha))); // Round right side for (int z=0,k=BTN_CNR_SIZE;k!=0;k--,z++) gdispGDrawRoundedBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width+z, gw->g.height, BTN_CNR_SIZE, pcol->edge); // Round left side for (int z=0,k=BTN_CNR_SIZE;k!=0;k--,z++) gdispGDrawRoundedBox(gw->g.display, gw->g.x-z, gw->g.y, gw->g.width+z, gw->g.height, BTN_CNR_SIZE, pcol->edge); // Write text string in the center gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+BTN_CNR_SIZE, gw->g.width-2, gw->g.height-(2*BTN_CNR_SIZE), gw->text, gw->g.font, pcol->text, justifyCenter); } I will try with images but i don't think that it can be much faster than this
  10. The custom routine that redraw a push button with rounded border is the following: void gwinButtonDraw_Rounded(GWidgetObject *gw, void *param) { const GColorSet * pcol; (void) param; if (gw->g.vmt != (gwinVMT *)&buttonVMT) return; pcol = getButtonColors(gw); gdispGFillArea(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, gw->pstyle->background); if (gw->g.width >= 2*BTN_CNR_SIZE+10) { gdispGFillRoundedBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, BTN_CNR_SIZE-1, pcol->fill); gdispGDrawStringBox(gw->g.display, gw->g.x+1, gw->g.y+BTN_CNR_SIZE, gw->g.width-2, gw->g.height-(2*BTN_CNR_SIZE), gw->text, gw->g.font, pcol->text, justifyCenter); gdispGDrawRoundedBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, BTN_CNR_SIZE, pcol->edge); } else { gdispGFillStringBox(gw->g.display, gw->g.x+1, gw->g.y+1, gw->g.width-2, gw->g.height-2, gw->text, gw->g.font, pcol->text, pcol->fill, justifyCenter); gdispGDrawBox(gw->g.display, gw->g.x, gw->g.y, gw->g.width, gw->g.height, pcol->edge); } } This routine don't fill the box blended from variants of the fill color (differently from the normal routine) Anyone know if there is already a running implementation of "custom routine rounded with gradient color" ? Thanks
  11. This is very impressive! What's the API name? Nice work. Is there a thread about it?
  12. Hi Someone can advise me on what is the best method to display a multi line label in ugfx? I've seen on ugfx studio that containers seems to do something similar with texts but they haven't the possibility to make align, so before try some test of custom routine i would like to ask what is the best approach Thanks
  13. Ok, so this is the default graph style i use How should i change it for have for example a x/y axis line size of 3 pixel? // A graph styling static GGraphStyle GraphStyle1 = { { GGRAPH_POINT_DOT, 2, Red }, // Point { GGRAPH_LINE_SOLID, 1, Red }, // Line { GGRAPH_LINE_SOLID, 25, Black }, // X axis { GGRAPH_LINE_SOLID, 25, Black }, // Y axis { GGRAPH_LINE_DOT, 5, Gray, 50 }, // X grid { GGRAPH_LINE_DOT, 5, Gray, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; By this way i get a x/y axis of 1 pixel
  14. Hi It's not clear for me if it's possible to change dynamically the size of the graph axis. The function gwinGraphDrawAxis seems to do that but i do not understand how should work Can anyone provide an example?
  15. It works! Thank you very much
  16. I'd like to switch between images (normal button and pressed button) when a specific button is pressed I want to use my set of routine for manage the events, so i need to change the image of the pressed and released button by my code A single image (normal button) is size 50x49, so i've merged the two images in a single file size 50 x 98 Is there a way to switch between the two images in a similar way that you do with your GINPUT/GEVENT mode ? (i mean programmatically) It's clear to me the way to switch between two different images (size 50x49), but i was wondering if there was the possibility to use a single image file /******************************************************************************/ /* This file has been generated by the uGFX-Studio */ /* */ /* http://ugfx.org */ /******************************************************************************/ #include "colors.h" #include "widgetstyles.h" #include "gui.h" // GListeners GListener glistener; // GHandles GHandle ghContainerPage0; GHandle ghARROW_UP; // Fonts font_t dejavu_sans_16; // Images gdispImage ARROW_UP_50x98; static void createPagePage0(void) { GWidgetInit wi; gwinWidgetClearInit(&wi); // create container widget: ghContainerPage0 wi.g.show = FALSE; wi.g.x = 0; wi.g.y = 0; wi.g.width = 800; wi.g.height = 480; wi.g.parent = 0; wi.text = "Container"; wi.customDraw = 0; wi.customParam = 0; wi.customStyle = 0; ghContainerPage0 = gwinContainerCreate(0, &wi, 0); // create button widget: ghARROW_UP wi.g.show = TRUE; wi.g.x = 350; wi.g.y = 200; wi.g.width = 50; wi.g.height = 49; wi.g.parent = ghContainerPage0; wi.text = ""; wi.customDraw = gwinButtonDraw_Image; wi.customParam = &ARROW_UP_50x98; wi.customStyle = 0; ghARROW_UP = gwinButtonCreate(0, &wi); } void guiShowPage(unsigned pageIndex) { // Hide all pages gwinHide(ghContainerPage0); // Show page selected page switch (pageIndex) { case 0: gwinShow(ghContainerPage0); break; default: break; } } void guiCreate(void) { GWidgetInit wi; // Prepare fonts dejavu_sans_16 = gdispOpenFont("DejaVuSans16"); // Prepare images gdispImageOpenFile(&ARROW_UP_50x98, "rsc/ARROW_UP_50x98.bmp"); // GWIN settings gwinWidgetClearInit(&wi); gwinSetDefaultFont(dejavu_sans_16); gwinSetDefaultStyle(&white, FALSE); gwinSetDefaultColor(black_studio); gwinSetDefaultBgColor(white_studio); // Create all the display pages createPagePage0(); // Select the default display page guiShowPage(0); } void guiEventLoop(void) { GEvent* pe; while (1) { // Get an event pe = geventEventWait(&glistener, 0); switch (pe->type) { } } }
  17. Is it possible to change the image of a Push Button programmatically without use GEVENT (and GINPUT) ? Thanks
  18. It's hard to explain but i'll try.. In my project i perfrom many gwinSetText that writes on different labels updating values, for example a time clock The refresh seems to be good but every 10-15 seconds i get a noisy "black refresh" on the widget In attachment my ugfx configuration. Any idea why this happen? The same thing happen if i put an image on another image and i perform gwinSetVisible action in way to switch betweeen images (like if it's a button) Some times i get a black area on the image. My project is a baremetal so there are not other threads and readrawing operations should be immediate. My MCU is a K64F Cortex M4 at 120Mhz... i don't think i should have these problems.. what do you think it could be? Thank you gfxconf.h
  19. Hi, i have a question about the navigation throught menus I have for example three menus : A() , B() , C() Whan i call for example the function A() it performs : a full clear screen (my primitive for my screen) set invisible every widget on menu B (gwinSetVisible) set invisible every widget on menu C (gwinSetVisible) destroy every widget on menu A (gwinDestroy) create every widget on menu A (gwinLabelCreate) set visible every widget on menu A(gwinSetVisible) redraw every widget on menu A (gwinRedraw) Whan i call the function B() it performs : a full clear screen (my primitive for my screen) set invisible every widget on menu C (gwinSetVisible) set invisible every widget on menu A (gwinSetVisible) destroy every widget on menu B (gwinDestroy) create every widget on menu B (gwinLabelCreate) set visible every widget on menu B(gwinSetVisible) redraw every widget on menu B (gwinRedraw) etc... It works, but it's very slow. I'm sure this is not the best method. I know for example that containers can perform destroy actions on all his child. Now i ask what are the right actions to perform a simple navigation throught menus and if exists examples about that Thank you
  20. Thank you very much! This example is very clear Do you have other routines example for make round buttons or something similar?
  21. Hi folks! Does someone wants to share their widgets rendering functions? Graphically I'm not very good so if anyone has some nice graphical effects (for example on the buttons) to share it would be really appreciated I would be very interested to know how you can achieve gradient effects Thank you!
  22. ForTest

    Numeric keypad

    Ok, thank you I also ask if it is possible to customize the widgets items for example the lighting color of a key pressed?
  23. ForTest

    Numeric keypad

    Hi Is it possible to change the layout of the widget "Keyboard" on the display to a numeric keypad? Thanks
  24. Yes, sorry KDS v.3.2.0 by Freescale http://www.nxp.com/products/software-and-tools/run-time-software/kinetis-software-and-tools/ides-for-kinetis-mcus/kinetis-design-studio-integrated-development-environment-ide:KDS_IDE
×
×
  • Create New...