RE: EuGrid - Phil Russel
- Posted by Phil Russell <pg_russell at lineone.net> Dec 21, 2002
- 395 views
Jonas, Your example code works fine on my home PC (win 95) using both version 1.0.1 and 1.1.0 of EuGrid. It sounds vaguely familiar as a problem that I (thought I) fixed for 1.1.0. The only difference that I can see in your code is that you have defined your column ids as atoms rather than constants. Internally in EuGrid they are held as integers, but I don't see why this should make a difference. Sorry I can't be more help. Phil Jonas Temple wrote: > Phil, > > Sorry, I would have sent this to your personally but I couldn't find > your address. > > Using the following example, do the following: > 1. When the window appears type something into the user column. > 2. Tab 3 times to go past the end of the row > 4. What appears to happen is the current cell shifts back to cell 1 (the > > value you typed in the first column is highlighted) but in actuality if > you press the up arrow key the first row is displayed. Note that what > you typed for the first column in the first row is duplicated in the > second row, even though an empty data row was passed on EGW_AddDataRow. > > Why does the grid scroll down when it doesn't need to and why is the > text being duplicated on the second row? > > I noticed that the Noah example works correctly and I can't seem to find > > the difference. > > Thanks! > > Jonas > > -- Beginning of code example > include Win32Lib.ew > include eugrid.ew > > atom user_col, rtn_code, user_desc_col, user_grp_col, void > > constant Main = createEx( Window, "Grid Test", 0, Default, Default, 600, > > 450, 0, 0 ) > constant MainSB = createEx( StatusBar, "", Main, 0, 0, 0, 0, 0, 0 ) > constant UsersGC = EGW_CreateGrid( Main, 10, 10, 575, 390, True) > user_col = EGW_AddColumn(UsersGC, "User Profile", 100, EGW_LAST, > EGW_EDIT, 1) > rtn_code = EGW_SetColumnProperty(UsersGC, user_col, EGW_COL_MAXCHARS, > 10) > user_desc_col = EGW_AddColumn(UsersGC, "Description", 300, EGW_LAST, > EGW_STATIC, 2) > user_grp_col = EGW_AddColumn(UsersGC, "Group Profile", 100, EGW_LAST, > EGW_STATIC, 3) > > procedure newUser() > sequence cell > integer row > > -- Get currently selected cell > cell = EGW_GetCurrentCell(UsersGC) > > -- If ok to exit current cell > if not sendMessage(UsersGC, EGW_CELLCHANGE, cell[1], cell[2]) > and not sendMessage(UsersGC, EGW_ROWCHANGE, cell[1], cell[2]) then > > rtn_code = EGW_AddDataRow(UsersGC, {"", "", ""}, EGW_LAST) > void = EGW_ScrollToCell(UsersGC, EGW_LAST, user_col) > > repaintWindow(UsersGC) > > end if > end procedure > > procedure UsersGC_onEvent(integer self, integer event, sequence parms) > atom msg, wParam, lParam, row_count > sequence check_users, msgs, user_info, user_desc, user_grp, user > object row_data > > msg = parms[1] > wParam = parms[2] > lParam = parms[3] > > if msg = EGW_LASTCELLTAB then > newUser() > returnValue(True) > end if > end procedure > setHandler(UsersGC, w32HEvent, routine_id("UsersGC_onEvent")) > > newUser() > WinMain(Main, Normal) > >