Mercurial > public > ostc4
comparison Discovery/Src/t7.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 | c880907fd1d7 |
children | d784f281833a |
comparison
equal
deleted
inserted
replaced
536:54c5ec8416c4 | 537:0ad0b26ec56b |
---|---|
2760 j += i; | 2760 j += i; |
2761 i = 0; | 2761 i = 0; |
2762 do | 2762 do |
2763 { | 2763 { |
2764 nextChar = settingsGetPointer()->customtext[i+j]; | 2764 nextChar = settingsGetPointer()->customtext[i+j]; |
2765 i++; | 2765 if(nextChar == '^') /* center */ |
2766 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) | 2766 { |
2767 break; | 2767 text[textptr++] = '\001'; |
2768 text[textptr++] = nextChar; | 2768 i++; |
2769 }else | |
2770 if(nextChar == 180) /* '´' => Right */ | |
2771 { | |
2772 text[textptr++] = '\002'; | |
2773 i++; | |
2774 }else | |
2775 { | |
2776 i++; | |
2777 if((!nextChar) || (nextChar =='\n') || (nextChar =='\r')) | |
2778 { | |
2779 break; | |
2780 } | |
2781 text[textptr++] = nextChar; | |
2782 } | |
2769 } while (i < 12); | 2783 } while (i < 12); |
2784 | |
2785 if(i == 12) /* exit by limit => check for blanks at the end of the string */ | |
2786 { | |
2787 while((textptr - 1 > 0) && (text[textptr - 1] == 32)) | |
2788 { | |
2789 textptr--; | |
2790 } | |
2791 } | |
2770 | 2792 |
2771 if(!nextChar) | 2793 if(!nextChar) |
2772 break; | 2794 break; |
2773 | 2795 |
2774 if(lineCount < 3) | 2796 if(lineCount < 3) |