Hello,
is it possible to save the whole text of a console in an array ?
Can I set the cursor on the position with a touch on the touchscreen?
Thanks
Solved! Go to Solution.
Thank you Luis, thank you Gargy
for your help.
I posted the cursor problem in another message.
Best Regards
Thomas
Hello,
Console object has an internal text array:
static D4D_CHAR name##_txtArray[line_cnt][char_cnt + 1];\
You can copy that array (line by line) to different array.
You can detect the touch in cosole with pOnUsrMsg call back function defined. Then, if the message is D4D_MSG_TOUCHED, calculate the position of cursor with the touch position [
D4D_POINT D4D_GetTouchScreenCoordinates(void);]
and move the cursor accordinly.
D4D_CnslGoToXY(D4D_OBJECT_PTR pObj, D4D_POINT newPosition)
I have never done, but I think is possible.
Bets Regards,
Hello,
and thank you for your fast answer.
Were is the name##_txtArray[line_cnt][char_cnt + 1] array defined and what do I have to write for
name## ?
My Console is declared as followd:
D4D_DECLARE_STD_CONSOLE(scrMain_Cons, "Kinetis Assembler", 0, 0, 320, 214, 100, 20,&bmpFreescale, FONT_ARIAL7, FONT_BERLIN_SANS_FBDEMI12)
Can I highlite the cursor by setting any flag ?
Thanks and have a nice weekend
Hello,
i found the text array. It is called scrMain_Cons_textArray[x][y].
But in this array I can't see the first line. The array beginns with the first character of the second line in [0][0].
Thanks
Thomas
Hi Thommi,
That is not the right array.
If you run the eGUI demo, you can add watch : scrLog_CnslLog_txtArray See attached image. You will see all the lines in the array. 'name' must be the name of the console object.
Regarding cursor,
D4D_CNSL_CURSOR_BLINK_TICK_COUNTER
is the constant to define the blink period, 0 is no cursor.
Best Regards,
Hello Luis,
thank you for your answer.
I think I have the right array. Im not using the demo.
I have a Console on the main screen (d4d_screen_main.c).
The Console is decleard as: D4D_DECLARE_SCREEN_OBJECT(scrMain_Cons)
So the array has the name: scrMain_Cons_txtArray[ ][ ] .
And in this array I can´t see the firs line. The array begins with the caracters of the second line of the Console.
The macro D4D_CNSL_CURSOR_BLINK_TICK_COUNTER is set to 10 (default) but the
cursor will not blink (I can't see the cursor)
Do I have to set a flag in the d4d_user_cfg.h file ?
Thank you
Thomas
Hi,
regarding to cursor, the issue should be that you have to also periodically call (in some function on time event) function void D4D_TimeTickPut(void) that notify eGUI about new time event and the macro D4D_CNSL_CURSOR_BLINK_TICK_COUNTER define how many these tick will be needed to blink with cursor.
And I take a look on the issue with array and let you now later in this thread.
Gargy
Hi,
regarding the first line in D4D_CONSOLE object:
The line is normally stored on end of defined text array (from any historical reason) but if want to move it on start of console array try to change this line in d4d_console.h :
static D4D_CNSL_DATA name##_data = { line_cnt - 1, {0, 0}, D4D_FALSE, 0, 0};\
to this state
static D4D_CNSL_DATA name##_data = { /*line_cnt - 1*/ 0, {0, 0}, D4D_FALSE, 0, 0};\
I try it and everithig looks fine but this is without any warranty :-D
Gargy
Hello Gargy,
thank you,t he cursor is blinking and the array is O.K.
I also have a little problem with the cursor.
When I put the cursor to a special position with
the command
cursor_position.x = 1;
cursor_position.y = 2;
(void) D4D_CnslGoToXY(&scrMain_Cons, cursor_position);
The cursor is displayed at the last position of the correct line.
After that I insert a character with the command:
(void)D4D_CnslPutString(&scrMain_Cons, "X");
The "X" is on position 1 in line 2, but the cursor is showen at the end of the line.
For your information, im writing code for a virtual keyboard.
Thank you
Thomas
Thank you Luis, thank you Gargy
for your help.
I posted the cursor problem in another message.
Best Regards
Thomas