Mercurial > public > ostc4
comparison Discovery/Src/tComm.c @ 537:0ad0b26ec56b
Added center / right alignment option to custom text display:
Per default custom text was shown left aligned. Using '^' for center and '?' for right alignment the display of the custom text may now be improved.
For proper operation the alignment had to be set to common handling mode and the blank characters had to be removed from the transmitted string.
To avoid display of special strings (e.g. multilanguage) the write text via com interface will now block special characters
author | Ideenmodellierer |
---|---|
date | Wed, 07 Oct 2020 18:07:10 +0200 |
parents | 5387e684d797 |
children | 667093daa937 |
comparison
equal
deleted
inserted
replaced
536:54c5ec8416c4 | 537:0ad0b26ec56b |
---|---|
238 } | 238 } |
239 | 239 |
240 | 240 |
241 void tComm_refresh(void) | 241 void tComm_refresh(void) |
242 { | 242 { |
243 char localString[255]; | |
244 | |
243 if(tCscreen.FBStartAdress == 0) | 245 if(tCscreen.FBStartAdress == 0) |
244 { | 246 { |
245 GFX_hwBackgroundOn(); | 247 GFX_hwBackgroundOn(); |
246 tCscreen.FBStartAdress = getFrame(18); | 248 tCscreen.FBStartAdress = getFrame(18); |
247 write_content_simple(&tCscreen, 0, 800, 480-24, &FontT24,"Exit",CLUT_ButtonSurfaceScreen); | 249 write_content_simple(&tCscreen, 0, 800, 480-24, &FontT24,"Exit",CLUT_ButtonSurfaceScreen); |
256 display_text[255] = 0; | 258 display_text[255] = 0; |
257 } | 259 } |
258 else if(display_text[255]) | 260 else if(display_text[255]) |
259 { | 261 { |
260 display_text[(uint8_t)display_text[255]] = 0; | 262 display_text[(uint8_t)display_text[255]] = 0; |
263 localString[0] = TXT_MINIMAL; | |
264 strcpy (&localString[1],display_text); | |
261 releaseFrame(18,tCscreen.FBStartAdress); | 265 releaseFrame(18,tCscreen.FBStartAdress); |
262 tCscreen.FBStartAdress = getFrame(18); | 266 tCscreen.FBStartAdress = getFrame(18); |
263 write_content_simple(&tCscreen, 0, 800, 480-24, &FontT24,"Exit",CLUT_ButtonSurfaceScreen); | 267 write_content_simple(&tCscreen, 0, 800, 480-24, &FontT24,"Exit",CLUT_ButtonSurfaceScreen); |
264 write_content_simple(&tCscreen, 800 - 70, 800, 480-24, &FontT24,"Signal",CLUT_ButtonSurfaceScreen); | 268 write_content_simple(&tCscreen, 800 - 70, 800, 480-24, &FontT24,"Signal",CLUT_ButtonSurfaceScreen); |
265 GFX_write_string(&FontT48, &tCwindow, display_text,2); | 269 GFX_write_string(&FontT48, &tCwindow, localString,2); |
266 GFX_SetFrameTop(tCscreen.FBStartAdress); | 270 GFX_SetFrameTop(tCscreen.FBStartAdress); |
267 display_text[0] = 0; | 271 display_text[0] = 0; |
268 display_text[255] = 0; | 272 display_text[255] = 0; |
269 } | 273 } |
270 } | 274 } |