• AVR Freaks

Helpful ReplyHot!Harmony Widgets rounded corners

Author
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
2018/07/26 12:57:13 (permalink)
0

Harmony Widgets rounded corners

Hi, is there any posibility for future Harmony versions to have widgets like text, labels, panels... with rounded corners?
#1
Ed@Microchip
Super Member
  • Total Posts : 134
  • Reward points : 0
  • Joined: 2017/04/06 09:39:29
  • Location: 0
  • Status: offline
Re: Harmony Widgets rounded corners 2018/07/26 15:57:27 (permalink)
4 (1)
There is very basic support for rounded widget corners in v2.06 at the API level, but it's not fully supported in MHGC. Also, only certain widgets are supported (label, buttons, panels) and works only if widgets do not have borders enabled.
 
You can try calling laWidget_SetCornerRadius() on the relevant widgets in libaria_init() and see if it works for your application.
post edited by Ed@Microchip - 2018/07/26 15:58:48
#2
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2018/07/27 08:44:53 (permalink)
0
Thanks Ed, it works perfect for the mentioned widgets. Happy now with the look of my app.
 
Thanks.
#3
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/04 20:18:45 (permalink)
0
Hi

How to use laWidget_SetCornerRadius (like for Rectangle)?
I have NOT seen this Graphics Libraries Help V2.06.

Please Update..

Thanks...
post edited by TS9 - 2019/02/04 20:32:52
#4
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2019/02/05 01:30:39 (permalink) ☄ Helpfulby TS9 2019/02/07 02:39:10
0
Hi, you have to open libaria_init.c and find the widget you want to change the border:
    YOUR_WIDGET = laLabelWidget_New();
    laWidget_SetPosition((laWidget*)YOUR_WIDGET, 8, 423);
    laWidget_SetSize((laWidget*)YOUR_WIDGET, 784, 45);
    laWidget_SetScheme((laWidget*)YOUR_WIDGET, &IMAGE);
    laWidget_SetBackgroundType((laWidget*)YOUR_WIDGET, LA_WIDGET_BACKGROUND_FILL);
    laWidget_SetBorderType((laWidget*)YOUR_WIDGET, LA_WIDGET_BORDER_NONE);
    laLabelWidget_SetVAlignment(YOUR_WIDGET, LA_VALIGN_TOP);
    laWidget_AddChild((laWidget*)layer1, (laWidget*)YOUR_WIDGET);
    laWidget_SetCornerRadius((laWidget*)YOUR_WIDGET,8);

 
Note the last line where the radius is set. Hope it helps.
#5
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/07 02:38:22 (permalink)
0
Hi,
 
Thanks It works ..partially .. 
I have checked as per  below  :

    ElectricalBkWidget = laRectangleWidget_New();
    laWidget_SetPosition((laWidget*)ElectricalBkWidget, 9, 54);
    laWidget_SetSize((laWidget*)ElectricalBkWidget, 191, 168);
    laWidget_SetScheme((laWidget*)ElectricalBkWidget, &ElectricalAndTimeScheme);
    laWidget_SetBackgroundType((laWidget*)ElectricalBkWidget, LA_WIDGET_BACKGROUND_FILL);
    laWidget_SetBorderType((laWidget*)ElectricalBkWidget, LA_WIDGET_BORDER_NONE);
    laWidget_AddChild((laWidget*)MainBkWidget, (laWidget*)ElectricalBkWidget);
    laWidget_SetCornerRadius((laWidget*)ElectricalBkWidget, 20);;

I am able to achieve rounded corners on rectangular widget but still border line still Rectangle .
Please Check attachment n Update..
 
--
TS9

Attached Image(s)

#6
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2019/02/07 03:15:57 (permalink)
0
Well, you have to set the thickness in the rectangle properties (Graphics Composer) to 0, by default is 2. You will have the effect you want.
 
Regards. Francisco.
#7
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/07 04:42:20 (permalink)
0
Hi jiggoly,
 
Thanks again .. Will this give with border line also??
Actually I also need Black border line as attached.
 
--
TS9

Attached Image(s)

#8
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2019/02/07 05:04:53 (permalink)
0
Hi again, if you set the rectangle widget border property to line you will get a thin line that is rounded too, don´t know if it´s enough for your requirements. Try it.
 
 
#9
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/07 05:22:47 (permalink)
0
Hi jiggoly,
 
OK.. No Issue ..
I will check tomorrow, then update.. I am using PIC32MZxxEFM part with LCC Configuration ..
Which Processor or MCU you are using?
 
 
--TS9
 
#10
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2019/02/07 05:27:08 (permalink)
0
 Hi, I was using MZ2048EFM but needed more memory and resolution so changed to PIC32MZ2064DAG and happy with the performance. Graphics with MZDA are fast also.
#11
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/07 05:41:57 (permalink)
0
Thanks ..
MZ2048EFM means ? LCC
I don't need much memory . LCC with PIC32MZxEFM part have Good results (WYSIWYG)
if I am using Graphic Composer . MHGC ?
Please share your experience .
#12
jiggoly
Junior Member
  • Total Posts : 112
  • Reward points : 0
  • Joined: 2016/01/19 15:02:48
  • Location: Spain
  • Status: offline
Re: Harmony Widgets rounded corners 2019/02/07 05:49:30 (permalink)
0
Not much to say, Bigger resolutions like 800x480 need bigger graphics (in memory size) and the framebuffer also needs more memory so that´s why I switched to MZDA. As you say I use Harmony 2.06 with Graphics Composer as the tool to design the graphical enviroment for the MZDA app.
#13
TS9
Super Member
  • Total Posts : 651
  • Reward points : 0
  • Joined: 2010/05/07 10:52:22
  • Status: online
Re: Harmony Widgets rounded corners 2019/02/07 05:56:13 (permalink)
0
OK


...Means ..If low  resolution (like 480 x 272) , less memory,low cost,low speed requirements then PIC32MZ EF performs Well.Is it ?


--TS9
post edited by TS9 - 2019/02/07 10:56:54
#14
Jump to:
© 2019 APG vNext Commercial Version 4.5