/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / LCD drawable area

Username:     
Password:     
             

Forum

# 1   2010-06-18 13:31:22 LCD drawable area

diabolo38
Member
Registered: 2010-03-12
Posts: 50

LCD drawable area

Actualy the tool bar area (y from 132 to 160)  is not drawable by rect ,line not char function from an  application. Only "Image" function  can be use by application to put something there so it doesnt  help for custom application tool bar  or if application want to to use the full screen sad that is my case (toolbar handler is replaced)

I took advantage of existing char filter and added some ack to remove the  limitation and leave full access for text function i also  changed  the LCD_FillRect to reuse the same filter

Code:

    __attribute__ ((section(".non_debuggable_code")))
    void LCD_FillRect( u16 x, u16 y, u16 width, u16 height, u16 color )
        {
        // Rq : this fuction is just a wrapper with parameter limit checks
        
        // Check the x parameters
        if (x < 0)
            x = 0;
        if (x > CharFilter_XMax)
            x = CharFilter_XMax;
        if ( (x + width) > CharFilter_XMax )
            width = CharFilter_XMax - x;
        
        // Check the y parameters
        if (y < 0)
            y = 0;
        if (y > CharFilter_YMax)
            y = CharFilter_YMax;
        if ( (y + height) > CharFilter_YMax )
            height = CharFilter_YMax - y;

        // Call the native function
        LCD_FillRect_Circle( x, y, width, height, color );
        }

Maybe this is somethings that could be added to a future circle release as well as making the DRAW_SetCharFilter() accessible on the application side.

Offline

 

# 2   2010-06-18 15:15:06 LCD drawable area

ntrf.zns
Member
From: Belgorod, Russia
Registered: 2009-11-01
Posts: 134

Re: LCD drawable area

Modifing char filer like that could break the menu drawing as far as i remember. Better to test that.

Anyway, raisonance seems to have a solution. It will be delivered in CircleOS for new Primer (Open4).

Offline

 

# 3   2010-06-21 06:24:25 LCD drawable area

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: LCD drawable area

Effectively, in order to make custom application tool bar, you can only use the functions "TOOLBAR_Set" or "TOOLBAR_ChangeButton".
And "if application want to to use the full screen", there is no solution using CircleOS and CircleOS API, and you have to write your own functions.
Ntrf, I don't know what about you thought about "solution", but this behavior is not forseen be changed with new versions of CircleOS.

Offline

 

# 4   2010-06-21 07:38:36 LCD drawable area

ntrf.zns
Member
From: Belgorod, Russia
Registered: 2009-11-01
Posts: 134

Re: LCD drawable area

yrt, you told me there will be a switch between different subscreen sizes: 128x128 and 240x240.

Offline

 

# 5   2010-06-21 09:54:41 LCD drawable area

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: LCD drawable area

The switch just indicates the LCD application area size which is 128x128 for Primer2, 240x240 for Open4, and only translates Primer2 coordinates to Open4 coordinates.
But the extra area (128 -> 160 for Primer2, 240 -> 320 for Open4) is always reserved for toolbar, and not available from CircleOS APIs, like LCD_FillRect, DRAW_DisplayString...

Offline

 

# 6   2010-06-21 10:09:48 LCD drawable area

diabolo38
Member
Registered: 2010-03-12
Posts: 50

Re: LCD drawable area

It  works with my fixes i can use text and rect function now  to paint the tools bar area  (OS API Rect was modified  to check over char filter limit instead of initial #define)
Maybe menu display are wrong ( but i do not used then on my app so it is fine for me)

Offline

 

Board footer