Mercurial > public > ostc4
comparison Discovery/Src/gfx_engine.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 | 56824129dd56 |
children | 7b56d4eda695 |
comparison
equal
deleted
inserted
replaced
536:54c5ec8416c4 | 537:0ad0b26ec56b |
---|---|
2031 settings.Xdelta = hgfx->WindowTab - hgfx->WindowX0; | 2031 settings.Xdelta = hgfx->WindowTab - hgfx->WindowX0; |
2032 else | 2032 else |
2033 if(*pText == '\r') // carriage return, no newline | 2033 if(*pText == '\r') // carriage return, no newline |
2034 settings.Xdelta = 0; | 2034 settings.Xdelta = 0; |
2035 else | 2035 else |
2036 if((*pText == '\001') && !minimal) // center | 2036 if((*pText == '\001')) // center |
2037 settings.Xdelta = GFX_write__Modify_Xdelta__Centered(&settings, hgfx, pText+1); | 2037 settings.Xdelta = GFX_write__Modify_Xdelta__Centered(&settings, hgfx, pText+1); |
2038 else | 2038 else |
2039 if((*pText == '\002') && !minimal) // right | 2039 if((*pText == '\002')) // right |
2040 settings.Xdelta = GFX_write__Modify_Xdelta__RightAlign(&settings, hgfx, pText+1); | 2040 settings.Xdelta = GFX_write__Modify_Xdelta__RightAlign(&settings, hgfx, pText+1); |
2041 else | 2041 else |
2042 if((*pText == '\003') && !minimal) // doubleSize | 2042 if((*pText == '\003') && !minimal) // doubleSize |
2043 settings.doubleSize = 1; | 2043 settings.doubleSize = 1; |
2044 else | 2044 else |
2984 uint32_t found; | 2984 uint32_t found; |
2985 uint32_t j; | 2985 uint32_t j; |
2986 | 2986 |
2987 pText = (uint32_t)pTextInput; | 2987 pText = (uint32_t)pTextInput; |
2988 counter = 0; | 2988 counter = 0; |
2989 while((counter < 100) && (*(char*)pText != 0) && (*(char*)pText != '\r')) | 2989 while((counter < 100) && (*(char*)pText != 0) && (*(char*)pText != '\r') && (*(char*)pText != '\n')) |
2990 { | 2990 { |
2991 if((*(char*)pText) == TXT_2BYTE) | 2991 if((*(char*)pText) == TXT_2BYTE) |
2992 { | 2992 { |
2993 backup = pText; | 2993 backup = pText; |
2994 | 2994 |