Jump to content

ForTest

Members
  • Posts

    53
  • Joined

  • Last visited

Posts posted by ForTest

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

     

  2. 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?

  3. 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) {
    		}
    
    	}
    }
     

     

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

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

  6. 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!

     

  7. Hi

    I am having trouble viewing more than 2 images in the same screen.

    I've imported 3 bmp into uGFX studio and generated the header file.

    The code for load a single BMP is this:
     

    GHandle ghImagebox3;
    
                    wi.g.show = TRUE;
                    wi.g.x = 400;
                    wi.g.y = 150;
                    wi.g.width = 67;
                    wi.g.height = 67;
                    ghImagebox3 = gwinImageCreate(0, &wi.g);
                    gwinImageOpenMemory(ghImagebox3, ico3);

     

    It works perfecty until i load 2 BMP

    Whan i try to open the third i cannot see it on the display

    I'm absolutely sure that x and y are in a valid area of the screen and there are not others widget on this area.

    Every ghImageBox element seems to be initialized correctly so i can understand why the image is not visible

     

     

    Suggest?

     

  8. Good morning
    I'd like to make the following thing:
    - Draw a graph (it's ok)
    - Show an image (or a box containing a fixed value or text)
    - The image should blink on the graph until another graph start

    For example i want to see the image on "example1.jpg" , after few seconds "example2.jpg", after few seconds "example1.jpg" , etc..

    Obviously the problem is the redrawing of the graph

    I think that the best way is to store the graph points then draw the image and redraw the missing points until the box is blinking


    I'd like to have suggests if there are better ways to do what i want or if i'm taking a wrong way
    Thank you very much and congratulations for the support that you bring to every user

     

     

    P.S.

    i can't use pixmap module because i can't include it with makefile

    others modules works properly

    example1.jpg

    example2.jpg

  9. Thank you for the suggests Joel

    a.  I will try

    b. I've tryed but is not working.. the TTF file is ok and the characters have all the same width, but when i export them and check the size (gdispGetStringWidth) i get different width values

    for example:

    "0" --> 43 pixels

    "1" --> 44 pixels

    "2" --> 43 pixels

    etc..

    in your opinion on what you can depend this additional pixels?

    c. ok it works! i've made a mistake in the settings property of a label

    Isonorm Monospaced RegularTTF.ttf

    Isonorm Monospaced RegularTTF80.c

  10. Hi

    I've seen a lot of project examples showing numberic values changes in real time

    I'm trying to do the same with a label widget but i have some issues:

     

    a. Using gwinSetText i get a refresh of the whole string so i get an annoying effect because all the area is turned black and redrawed character by character.

    b. Every digit can have a different width from each other so if i refresh them is it possible to see each character move left or right. Although this effect is annoying.

    c. The label widget doesnt have a left alignment. For example if i want to put a counter in the top-right of the corner it should see the number increasing its digits from the right to the left.

     

    So i ve made an array of label. Every label contain a single digit or a  "." , so the width is fixed to the maximum width of a digit or the width of a "." and this solve the b.  and also a. because using array i can refresh only digits that are changed

    I'm working on c. because it is necessary to reverse the original string and do some stuff

     

    I wonder if anyone has already had to deal with these problems and how he dealt

    I'd like to know if there are ways more 'effective and maybe already made that resolve the problems I have described

     

  11. UPDATE

     

    I've made a preset with a font Isonorm Bold (IsonormBold.ttf)

    http://oi64.tinypic.com/5l2clu.jpg

    I've made another preset with a font Isonorm Regular (Isonorm-regular.ttf)

    http://oi65.tinypic.com/2yud940.jpg

     

    In uGFX Studio when i set the regular font preset to a label i get this:

    http://oi65.tinypic.com/20573u1.jpg

    If i apply the bold preset to another label i continue to see the regular version:

    http://oi67.tinypic.com/msjhvp.jpg

     

    It's quite strange

    I get the same thing on the display

     

  12. In attachment the font i've used

    Isonorm-regular.ttf is the starting true type font and it works but i have only the regular version, so i've tryed to edit the numbers and make them in bold using FontForge (changing the width)

    http://oi65.tinypic.com/2iuu68y.jpg

    The result is Isonorm_modified.ttf

    When i try to build the array to convert the TTF to .C file i get a bad format error message

     

    Probably i make a mistake or maybe the tool i've used is wrong for do this

     

    Isonorm_modified.ttf

    Isonorm-regular.ttf

  13. Hello

    I've searched on the forum about the topic but nothing i've found :)

    My question is: how can i import a TTF bold?

    I've seen in the examples that Dejavu Font already start in bold version. What tool have you used? I've tryed FontForge but when i try to convert the TTF to .C table i get a wrong format message

  14. It works!

    It was quite complicated to reconstruct the right hierarchy of the modules but in the end it works.

    Some useful tips:

    - makefile don't work for me in KDS so i used the inclusion of "gfx_mk.c"

    - many path into the g-directory have a wrong path ("../.." missing) so... enjoy :) & good luck to redefine them!

    - try to change values from the top to the bottom of the "gfxconf.h" and see if compile errors decrease

    - check to put "TRUE" the show of the widget ghContainerPage0  (into "gui.c")  because was set "FALSE" by default from the uGFX Studio

    - "gl" is a variable set by the environment so it is necessary to change the name into the "gui.c" (GListener)

     

    In attachment my configuration file for bare metal os

    Tested on K64F with KDS 3.2.0 on ARM Cortex M4


    Thank you very much

     

    gfxconf.h

×
×
  • Create New...