1. Phil Russel - EuGrid

Phil,

Attached is a small program where I'm attempting to create a calendar
with EuGrid.  It does pretty much what I want it to but I would like to
suggest something.  When a cell is non-editable, would it be possible to
not have the edit control appear in the grid?  To see what I mean, try
the example program and click the cell in red (or any other cell for that
matter).  The background changes to the Windows background and the text
is highlighted.  Since the cell is in red and non-editable this makes the
cell look "strange".

Hope I've explained myself well. BTW, when are you going to release
V1.3.0 of EuGrid?

Thanks,

Jonas

--  code generated by Win32Lib IDE v0.18.11

 
include Win32Lib.ew
without warning
include euGrid.ew
atom gridvoid

--------------------------------------------------------------------------------
--  Window Window1
constant Window1 = createEx( Window, "Window1", 0, Default, Default, 636, 461,
0, 0 )
integer EuGrid2 EuGrid2 = EGW_CreateGrid( Window1, 76, 52, 424, 324, 1 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ACTIVE_HEADERS, False )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ALLOW_COL_RESIZE, False )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ALLOW_COL_SORT, False )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_HIGHLIGHT_TEXT, True )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ROW_HEADER_DATACOL,EGW_ROWNUM )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ROW_HEADER_WIDTH,0 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_COL_HEADER_HEIGHT,20 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_BACKGROUND_COLOR,16777215 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_BACKGROUND_COLOR,16777215 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_ROW_HEIGHT,50 )
gridvoid = EGW_SetGridProperty( EuGrid2, EGW_TEXT_ALIGN,EGW_CENTER )
integer SundayET SundayET = EGW_AddColumn( EuGrid2, "Sunday", 100, EGW_LAST,
EGW_EDIT, 1 )
gridvoid = EGW_SetColumnProperty( EuGrid2, SundayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, SundayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, SundayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, SundayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, SundayET, EGW_COL_MULTILINE, 1)
integer MondayET MondayET = EGW_AddColumn( EuGrid2, "Monday", 100, EGW_LAST,
EGW_EDIT, 2 )
gridvoid = EGW_SetColumnProperty( EuGrid2, MondayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, MondayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, MondayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, MondayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, MondayET, EGW_COL_MULTILINE, 1)
integer TuesdayET TuesdayET = EGW_AddColumn( EuGrid2, "Tuesday", 100, EGW_LAST,
EGW_EDIT, 3 )
gridvoid = EGW_SetColumnProperty( EuGrid2, TuesdayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, TuesdayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, TuesdayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, TuesdayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, TuesdayET, EGW_COL_MULTILINE, 1)
integer WednesdayET WednesdayET = EGW_AddColumn( EuGrid2, "Wednesday", 100,
EGW_LAST, EGW_EDIT, 4 )
gridvoid = EGW_SetColumnProperty( EuGrid2, WednesdayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, WednesdayET,
EGW_COL_BACKGROUND_COLOR, 16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, WednesdayET, EGW_COL_ALIGN,
EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, WednesdayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, WednesdayET, EGW_COL_MULTILINE, 1)
integer ThursdayET ThursdayET = EGW_AddColumn( EuGrid2, "Thursday", 100,
EGW_LAST, EGW_EDIT, 5 )
gridvoid = EGW_SetColumnProperty( EuGrid2, ThursdayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, ThursdayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, ThursdayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, ThursdayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, ThursdayET, EGW_COL_MULTILINE, 1)
integer FridayET FridayET = EGW_AddColumn( EuGrid2, "Friday", 100, EGW_LAST,
EGW_EDIT, 6 )
gridvoid = EGW_SetColumnProperty( EuGrid2, FridayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, FridayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, FridayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, FridayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, FridayET, EGW_COL_MULTILINE, 1)
integer SaturdayET SaturdayET = EGW_AddColumn( EuGrid2, "Saturday", 100,
EGW_LAST, EGW_EDIT, 7 )
gridvoid = EGW_SetColumnProperty( EuGrid2, SaturdayET, EGW_COL_WIDTH, 60 )
gridvoid = EGW_SetColumnProperty( EuGrid2, SaturdayET, EGW_COL_BACKGROUND_COLOR,
16777215)
gridvoid = EGW_SetColumnProperty( EuGrid2, SaturdayET, EGW_COL_ALIGN, EGW_RIGHT)
gridvoid = EGW_SetColumnProperty( EuGrid2, SaturdayET, EGW_COL_EDITABLE, False)
gridvoid = EGW_SetColumnProperty( EuGrid2, SaturdayET, EGW_COL_MULTILINE, 1)
setFont( EuGrid2,"Arial",8,Normal)
constant LText18 = createEx( LText, "LText18", Window1, 0, 0, 0, 0, 0, 0 )
setFont( LText18,"Arial",8,Normal)
---------------------------------------------------------
--------------------------------------------------------------------------------
atom void, hFontArial
constant NEWLINE = 13&10

with trace
--------------------------------------------------------------------------------
procedure Window1_onOpen (integer self, integer event, sequence params)--params
is ()
	for i = 1 to 6 do
		void = EGW_AddDataRow(EuGrid2, {"","","","","","",""}, EGW_LAST)
	end for
	hFontArial = sendMessage(LText18, WM_GETFONT, 0, 0)	
end procedure
setHandler( Window1, w32HOpen, routine_id("Window1_onOpen"))
--------------------------------------------------------------------------------
procedure EuGrid2_onEvent (integer self, integer event, sequence params)--params
is ( int iMsg, atom wParm, atom lParm )
    atom msg, wParam, lParam, row_count, row, col
    sequence check_names, msgs
    object row_data

    -- Extract message and params
    msg = params[1]
    wParam = params[2]
    lParam = params[3]

    if msg = EGW_CELLFORMAT then
    	row = EGW_GetCellProperty(self, wParam, EGW_CELL_ROW)
    	col = EGW_GetCellProperty(self, wParam, EGW_CELL_COL_ID)
    	if row = 1 and col = 3 then
void = EGW_SetCellProperty(self, wParam, EGW_CELL_BACKGROUND_COLOR,
BrightRed)
			void = EGW_SetCellProperty(self, wParam, EGW_CELL_TEXT,
					"1" & NEWLINE & "7:00" & NEWLINE & "Cubs")
			void = EGW_SetCellProperty(self, wParam, EGW_CELL_TEXT_COLOR, BrightWhite)
			void = EGW_SetCellProperty(self, wParam, EGW_CELL_FONT, hFontArial)
		elsif (row = 1 and col <= 2) or (row = 6 and col >= 4)  then
void = EGW_SetCellProperty(self, wParam, EGW_CELL_BACKGROUND_COLOR,
LightGray)
		end if
	end if
end procedure
setHandler( EuGrid2, w32HEvent, routine_id("EuGrid2_onEvent"))


WinMain( Window1,Normal )

new topic     » topic index » view message » categorize

2. Re: Phil Russel - EuGrid

Phil,

You can disregard my previous postings about EuGrid.  I found my solution 
with:

* I found the EGW_HIGHLIGHT_TEXT in the docs to disable text hightlighting
* I looked into eugrid.ew and found the undocumented cell property of
EGW_CELL_DISABLED cell property which stopped displaying of the edit 
control.  However, I would think that the EGW_COL_EDITABLE column style
would take care of that.

Now, on to another question (one for which I cannot find a solution for).
There's a EGW_CELLCHANGE message that is sent when a user tabs or
uses the arrow keys to move out of a cell.  Is there a way to trap when
the user tabs/arrow keys move INTO a cell?

Hope you get this message!

Jonas

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu