Jump to content

wctltya

Members
  • Content Count

    84
  • Joined

  • Last visited

About wctltya

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @neon1 Have you tried instead of passing NULL pointer here gwinSetText(ghTextedit, NULL, FALSE), to pass a pointer to a char buff, which first element is 0, or just gwinSetText(ghTextedit, "", FALSE) ?
  2. wctltya

    A bug in gfxRealloc()

    Hi Joel an inmarket, I was created this topic because I'm not sure you have seen may last post here and because it is important to be fixed as well as to warn the other users.
  3. wctltya

    gwinButtonDraw_Image help

    Actually It is, just use the new line inside the text and the library will take care. I've the following code for example: snprintf(buff, sizeof(buff), "%s\n%s", GetStringResource(txtUnitbackupsTitle[unbackupsItem_IAMtoMB], language), TextBuff); gwinSetText(ghUnitbackupsPageElmButton[unbackupsItem_IAMtoMB], buff, TRUE);
  4. wctltya

    TextEdit widget Issue

    @inmarket Definitely there is a bug and it is obvious, I think. See line 138 in gos_x_heap.c: if (pfree) return 0; Should be if (!pfree) return 0; And this fixes the issue.
  5. wctltya

    Font Converter

    Hi, The uGFX studio's v.0.24.1 font converter has an option (check box) Anti-Alias when it is used from studio. Why this options doesn't exists in the mcufont.exe (..\foo\ugfx\tools\mcufontencoder\binaries\windows\), attached is a screenshot. Or if it does exists, how to use it? BTW about adding a new font in studio: 1. It will be nice to have an option for multi-range in case of "Custom Range" is selected for filter. For example a "+" button can add another range selector line. 2. "Unnamed" is a very annoying. I know that using F2 I can rename it, but have a look at the generated font files. If I keep it not renamed, the file name is "unnamed_arial_regular12_aa" for example and it is similar for constants and defines inside. Or if I rename it for example to "arial_regular12_aa", then the file name is "arial_regular12_aa_arial_regular12_aa", and same for constants and defines.
  6. wctltya

    TextEdit widget Issue

    Hi again, I found what actually is causing the issue, I think and it is Although I've RAW32 defined and relevant heap size as well, seems that another 60k are booked for OS, which I don't use. Since I didn't expect this, and because it is something left just from the beginning of the project, I haven't look into the linker output for. Now I can see it. Joel and inmarket, definitely it's my mistake. But a common detailed description of the all keys in gfxconf with their relations etc., will help us to avoid such mistakes, I think. For example I've removed as well, supposing (now) it is not relevant to RAW32 too? Do you think a regression test is needed now? I'm afraid it is too complicated and will take a lot of time, because the project is in a very advanced stage.
  7. wctltya

    TextEdit widget Issue

    The quote from previous report of the same issue: " Thank you inmarket, Just FYI - I'm running RAW32. The uC is Cortex-M4 with plenty of resources (Flash, RAM, FPU). The project is under KDS (single file including) with GCC compiler and the relevant gfxconf are: #define GFX_USE_OS_RAW32 TRUE #define GFX_COMPILER GFX_COMPILER_GCC #define GFX_CPU GFX_CPU_CORTEX_M4_FP #define CORTEX_USE_FPU TRUE #define GFX_EMULATE_MALLOC FALSE And the heap size is set accordingly. I was wondering if the compiler shall be set to GFX_COMPILER_ARMCC? Please, let me know, if I shall turn on/off some other keys.. " Except the compiler definition, which I've removed according to your advice Inmarket. In addition: #define GFX_CPU_ENDIAN GFX_CPU_ENDIAN_UNKNOWN #define GOS_RAW_HEAP_SIZE 61440UL //RAW32 relevant #define GFX_OS_HEAP_SIZE 61440UL #define GFX_OS_NO_INIT TRUE Please, let me know if I've to change something.
  8. wctltya

    TextEdit widget Issue

    Hi Joel and Inmarket, Almost an year ago I've reported this issue, but perhaps with very bad and complicated explanation and I didn't get support on it. So, today I dig more into and debug it a bit. I'll try to describe the issue and my findings shortly and as clear as possible: I have 3 textedit widgets, each into its own container(together with two labels), but all of them are in a common parent container. All textedits widgets are restricted to 4 chars max. But we can focus on two edit box only. Lets name them TE_1 and TE_2. Adding max 4 chars in TE_1 is not a problem, unless at least one char is added in TE_2, then I can't add 4th char in TE_1. I'm restricting explanation to TE_1, because even it is the same for TE_2 related to TE_1 its getting more complicated... Please see the attached video file. Debugging the issue, shows that the TextEditAddChars(...) in line 74 invokes gfxRealloc(...) , which returns 0 in line 139, which leads to TextEdditAddChars returns FALSE in line 75. The particular parameters (filmed in the attached video) passed to gfxRealloc are pointer to "111", oldsize is 4 and size is 5. Perhaps old size and size includes the NULL terminator, otherwise they should be 3 and 4, I think. But this doesn't cause the issue, as long as the same values are passed when it works, i.e. when TE_2 is empty. The link to my previous report describing that issue is here(see the last post) VID_20180705_090553.mp4
  9. wctltya

    Graph bug

    BTW, my application requiring a second Y-axis (right side), so I've created a function for it. You might would like to consider adding an optional second Y-axis to a next library revision as well.
  10. wctltya

    Graph bug

    Thank you Joel, As usual it is my mistake
  11. wctltya

    Graph bug

    // A graph styling static GGraphStyle GraphStyle1 = { { GGRAPH_POINT_DOT, 0, Blue }, // Point { GGRAPH_LINE_NONE, 2, Gray }, // Line { GGRAPH_LINE_SOLID, 0, Red/*White*/ }, // X axis { GGRAPH_LINE_SOLID, 0, Blue/*White*/ }, // Y axis { GGRAPH_LINE_DASH, 5, Red/*Gray*/, 50 }, // X grid { GGRAPH_LINE_DOT, 7, Blue/*Yellow*/, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; // Another graph styling static const GGraphStyle GraphStyle2 = { { GGRAPH_POINT_SQUARE, 5, Red }, // Point { GGRAPH_LINE_DOT, 2, Pink }, // Line { GGRAPH_LINE_SOLID, 0, Red/*White*/ }, // X axis { GGRAPH_LINE_SOLID, 0, Blue/*White*/ }, // Y axis { GGRAPH_LINE_DASH, 5, Red/*Gray*/, 50 }, // X grid { GGRAPH_LINE_DOT, 7, Blue/*Yellow*/, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; so: x-Grid, shall be Red, Dash-line y-Grid, shall be Blue, Dot-line
  12. wctltya

    Graph bug

    The attached image quality is not the best one, but it is enough to see that the grid x/y are exchanged. It is always better to read the doc's first - saw the window background color is the default background color.
  13. wctltya

    Graph bug

    Hi guys, Sorry for delayed replay. The code looks like: // GHandles static GHandle ghGraphPageContainer; static GHandle ghGraphPageToolbarButtonBack; static GHandle ghGraphPageContentContainer; static GHandle ghGraphPageGraphWindow; // A set of data points that will be displayed in the graph static const point data[5] = { { -40, -40 }, { 70, 40 }, { 140, 60 }, { 210, 60 }, { 280, 200 } }; // A graph styling static GGraphStyle GraphStyle1 = { { GGRAPH_POINT_DOT, 0, Blue }, // Point { GGRAPH_LINE_NONE, 2, Gray }, // Line { GGRAPH_LINE_SOLID, 0, Red/*White*/ }, // X axis { GGRAPH_LINE_SOLID, 0, Blue/*White*/ }, // Y axis { GGRAPH_LINE_DASH, 5, Red/*Gray*/, 50 }, // X grid { GGRAPH_LINE_DOT, 7, Blue/*Yellow*/, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; // Another graph styling static const GGraphStyle GraphStyle2 = { { GGRAPH_POINT_SQUARE, 5, Red }, // Point { GGRAPH_LINE_DOT, 2, Pink }, // Line { GGRAPH_LINE_SOLID, 0, Red/*White*/ }, // X axis { GGRAPH_LINE_SOLID, 0, Blue/*White*/ }, // Y axis { GGRAPH_LINE_DASH, 5, Red/*Gray*/, 50 }, // X grid { GGRAPH_LINE_DOT, 7, Blue/*Yellow*/, 50 }, // Y grid GWIN_GRAPH_STYLE_POSITIVE_AXIS_ARROWS // Flags }; void createPageGraph(void) { GWidgetInit wi; gwinWidgetClearInit(&wi); //Creates a page container with show = false, a toolbar inside with a title and a back button page_common_start(&ghGraphPageContainer, &ghGraphPageToolbarButtonBack, NO_SUB_PAGE_BUTTON, NO_SUB_PAGE_BUTTON_LABEL, strID_SERVICE_LOGS_PARAMETERS_GRAPHS_TITLE, 0); //no subpages //Creates a content container with application's common backgownd color page_common_add_generic_container(&ghGraphPageContainer, &ghGraphPageContentContainer); //Graph 320x320 wi.g.show = TRUE; wi.g.x = 0; wi.g.y = (PAGE_COMMON_ELEMENTS_HEIGHT - 320)/2; wi.g.width = 320; wi.g.height = 320; wi.g.parent = ghGraphPageContentContainer; //wi.customStyle = &black; //doesn't work ghGraphPageGraphWindow = gwinGraphCreate(0, &wi.g); } void graphPageDrawGraph(GHandle gh) { uint16_t i; /* doesn't work * gwinSetBgColor(gh, Black); gwinRedraw(gh);*/ // Set the graph origin and style gwinGraphSetOrigin(gh, gwinGetWidth(gh)/2, gwinGetHeight(gh)/2); //middle gwinGraphSetStyle(gh, &GraphStyle1); gwinGraphDrawAxis(gh); // Draw a sine wave for(i = 0; i < gwinGetWidth(gh); i++) { gwinGraphDrawPoint(gh, i-gwinGetWidth(gh)/2, 80*sin(2*0.2*M_PI*i/180)); } // Modify the style gwinGraphStartSet(gh); GraphStyle1.point.color = Green; gwinGraphSetStyle(gh, &GraphStyle1); // Draw a different sine wave for(i = 0; i < gwinGetWidth(gh)*5; i++) { gwinGraphDrawPoint(gh, i/5-gwinGetWidth(gh)/2, 95*sin(2*0.2*M_PI*i/180)); } // Change to a completely different style gwinGraphStartSet(gh); gwinGraphSetStyle(gh, &GraphStyle2); // Draw a set of points gwinGraphDrawPoints(gh, data, sizeof(data)/sizeof(data[0])); } void showPageGraph(void) { gwinShow(ghGraphPageContainer); graphPageDrawGraph(ghGraphPageGraphWindow); } //The main loop invokes: createPageGraph(); showPageGraph(); I'm not in front of device(tomorrow I'll post a picture), but the rendered window is: - white background color, - both sine are OK, i.e. they are drawn horizontally - the third line and dots are OK, - x axle is solid red west - east line, i.e. horizontal (------>) - y axle is solid blue, south - north line, i.e. vertical - the origin is in the graph window center - x grid's lines are dot, blue (according to GraphStyle1/2 above must be dashed red lines) - y grid's lines are dash, red (according to GraphStyle1/2 above must be doted blue lines) i.e. everything is fine, except the grid and background. The displays is 320x480 and its orientation is fine.
  14. wctltya

    Graph bug

    I've implemented the graph demo but the picture looks slightly different than result-640x480.gif (aside of the widow dimensions, of course) : 1. Seems the Graph grid x/y are exchanged? Obviously the mistake is in gwin_graph.c between lines 220 and 238. 2. The background color is not black, so in order to see the axes and grid I've changed their colors. In order to set it's background I tried: - setting custom style at creation time wi.customStyle = &black; and - setting the widget color at drawing time: gwinSetBgColor(gh, Black); gwinRedraw(gh); both w/o success. Could you tell me, please, how can I set it?
  15. wctltya

    Bugs or issues (maybe)

    @inmarket Sorry but seems there is another issue which happens when there are more textedit on a page. I have 3 on a page, but lets assuming there are two (TE1 and TE2), both are limited to 4 chars. Typing in TE1 up to 4 chars, clearing one or more etc. (I'm using virtual kb) is OK, then just focus the TE2(w/o typing), getting back to TE1, still OK; But if: 1. I type one char only in TE2 (assuming TE1 is full) 2. then getting back to TE1 and clear(backspace) one char, suddenly the limit for TE1 becomes 3, 3. then focus on TE2 and I can't type more chars, including replacing of exited. The order (TE1 then TE2 or TE2 then TE1) doesn't matter. The starting number of chars entered in the first TEx also doesn't matter. Sounds like a "magic" relations between TE widgets. There are many variations of that bug, hopefully I've described it well. But even I've not, play a bit and will see it.
×