2018-07-11 10:02 PM
Dear every body,
I'm doing project about lcd tft 7inch 800x480 and stm32f746.
Currently, i want use external keypad (or external button), not use touch screen pannel.
Example:
http://hshop.vn/products/ban-phim-ma-tran-mem-4x4
I have 1 button on LCD:
// { BUTTON_CreateIndirect, 'Browse', ID_BUTTON_0, 13, 8, 100, 20, 0, 0x0, 0 },
(x,y) = (13,8).
width = 100.
height = 20.
=> (x,y) center = (13+100/2 = 63,8+20/2=18).
When 1 keypad or button pressed, i checked that ok.
How to mapping 1 key pressed to WM_NOTIFICATION_CLICKED event of
ID_BUTTON_0 (ID_BUTTON_0 is displayed on LCD)? After that, emwin will do something: show dialog...
Can you tell me solutions, please?
Thank you so much!
#tft-lcd-touch-screen-mapping-by-external-keypad2018-07-13 12:34 AM
Dear you,
The same old link:
https://drive.google.com/drive/folders/1dHgIe4uFZUElhIBmTC-IFxvM4C0D2oIs
https://drive.google.com/drive/folders/1dHgIe4uFZUElhIBmTC-IFxvM4C0D2oIs
2018-07-13 12:37 AM
Publish your project
2018-07-13 12:51 AM
Oh, many thanks.
Next step, i'm hearing you tell me about:
'Up/Down button to up/down file name in list file on TREEVIEW.
Ok button to select file (name of hItem to next funtion).'
2018-07-13 01:11 AM
I would make it easier
I would create three buttons with names file1 file2 file3& and would emulate their pressing
2018-07-13 02:02 AM
I can not open your
WindowDLG_Test.c.
using the program GUIBuilder.You must modify this file only insert your code only between
// USER START
.....your code
// USER END
2018-07-13 02:04 AM
Dear you,
When you finish code, you please update link for me.
Thank you.
2018-07-13 02:44 AM
I correct your file by add this
//
// Initialization of 'USB' // hItem = WM_GetDialogItem(pMsg->hWin, ID_TREEVIEW_0); hTreeItemCur = TREEVIEW_GetItem(hItem, 0, TREEVIEW_GET_LAST); hTreeItemNew = TREEVIEW_ITEM_Create(TREEVIEW_ITEM_TYPE_NODE, ' file1.txt', 0); TREEVIEW_AttachItem(hItem, hTreeItemNew, hTreeItemCur, TREEVIEW_INSERT_BELOW); hTreeItemCur = TREEVIEW_GetItem(hItem, 0, TREEVIEW_GET_LAST); hTreeItemNew = TREEVIEW_ITEM_Create(TREEVIEW_ITEM_TYPE_NODE, ' file2.txt', 0); TREEVIEW_AttachItem(hItem, hTreeItemNew, hTreeItemCur, TREEVIEW_INSERT_BELOW); hTreeItemCur = TREEVIEW_GetItem(hItem, 0, TREEVIEW_GET_LAST); hTreeItemNew = TREEVIEW_ITEM_Create(TREEVIEW_ITEM_TYPE_NODE, ' file3.txt', 0); TREEVIEW_AttachItem(hItem, hTreeItemNew, hTreeItemCur, TREEVIEW_INSERT_BELOW); hTreeItemCur = TREEVIEW_GetItem(hItem, 0, TREEVIEW_GET_LAST); hTreeItemNew = TREEVIEW_ITEM_Create(TREEVIEW_ITEM_TYPE_NODE, ' file4.txt', 0); TREEVIEW_AttachItem(hItem, hTreeItemNew, hTreeItemCur, TREEVIEW_INSERT_BELOW); // // Initialization of 'OK' //2018-07-13 02:49 AM
Dear you,
I have finished
treeview_up() function. It is ok.
My code:
void treeview_up(void) { WM_HWIN hTree0; TREEVIEW_ITEM_Handle hTVI0, hTVI1; hTree0 = WM_GetDialogItem(WM_GetFirstChild(WM_HBKWIN), ID_TREEVIEW_0); hTVI0 = TREEVIEW_GetSel(hTree0); if (hTVI0) { hTVI1 = TREEVIEW_GetItem(hTree0, hTVI0, TREEVIEW_GET_PREV_SIBLING); if (hTVI1) { TREEVIEW_ITEM_Detach(hTVI0); TREEVIEW_AttachItem(hTree0, hTVI0, hTVI1, TREEVIEW_INSERT_ABOVE); TREEVIEW_SetSel(hTree0, hTVI0); } else { GUI_MessageBox('Item is already on top!', 'Info', GUI_MESSAGEBOX_CF_MODAL); WM_SetFocus(hTree0); } }}How to check, get text content in treeview hItem? 'file1.txt', 'file2.txt', 'file3.txt' or 'file4.txt'
char* treeview_select_file(void){
char* s_file; WM_HWIN hTree0; TREEVIEW_ITEM_Handle hTVI0; TREEVIEW_ITEM_INFO ItemInfo; hTree0 = WM_GetDialogItem(WM_GetFirstChild(WM_HBKWIN), ID_TREEVIEW_0); hTVI0 = TREEVIEW_GetSel(hTree0); if (hTVI0) { TREEVIEW_ITEM_GetInfo(hTVI0, &ItemInfo); if(ItemInfo.IsNode == 0){//Khong phai node //do something to copy file name to s_file??? } }}2018-07-13 03:08 AM
Buttons must emulate pressed on
TREEVIEW area
2018-07-13 05:03 AM
Dear Vitaliy Chernobay,
I have other question, i need your helps.
Content:
- I have 3 icon (circle, rectangle, triangle) image .png, .jpg, .bmp...I show on 'window dialog' or 'framewin dialog'.
Dimension of icon about 100x100 pixel.
When I get event up/down from external button,
circle/rectangle/triangle iamge will be selected.
ok event to select current to next funtion.
Can you tell me about solutions to do that?
Thank you!