Cursor placement, Cell highlight etc (OpenInsight 32-bit Specific)
At 25 MAY 2005 12:14:59PM Casey Greenwood wrote:
I'm trying to figure out a way to make it easier to see where the cursor placement occurs in our current system. I really like the way the old AREV DOS systems show this and would like to be able to replicate it somehow in my OI 7.X version.
I've tried several things with EditTables such as COLOR_BY_POS - and this works fairly well with a PosChanged Event but is inconsistent with GotFocus and LostFocus. I've also utilized FORECOLOR and BACKCOLOR with EditLines, but again, it's inconsistent.
The other difficulty is turning this off (from the previous item, either cell or editline) when I go to the next one. I would also like to implement this globally so it would work for my entire system for all "GOTFOCUS" OR "LOSTFOCUS" Events, turning on and off.
As far as Cursor changes, it seems like making it flash or highlight does not seem to be an option (or at least not one I've found).
Any ideas would be appreciated.
Casey greenwood
At 25 MAY 2005 12:46PM [email protected]'s Kevin Fournier wrote:
Casey,
You can use Promoted Events to create global behavior in your application. The OpenInsight Help contains information on this, and there are white papers from Sprezzatura and SRP. Once you have that in place, you can use code similar to this for your auto-highlighting:
* Get the control's type Type=Get_Property(CtrlEntId, "TYPE") If Type EQ "EDITFIELD" OR Type EQ "EDITBOX" OR Type EQ "LISTBOX" OR Type EQ "COMBOBOX" then * Get the last control with focus LastCtrl=Get_Property(@Window, "@FOCUS_CTRL") * Set the last control's colors back to normal OldColor=If Get_Property(LastCtrl, "REQUIRED") then COLOR_REQ_LIGHT$ else GetSysColor(COLOR_WINDOW$) Set_Property(LastCtrl, "BACKCOLOR", OldColor) * Set this control's colors to be highlighted NewColor=If Get_Property(CtrlEntId, "REQUIRED") then COLOR_REQ_MED$ else Yellow$ Set_Property(CtrlEntId, "BACKCOLOR", NewColor) Set_Property(@Window, "@FOCUS_CTRL", CtrlEntId) endMy sample code only deals with a few types of controls, but you get the idea. I use a user-defined property to remember that last control on the form with focus. So on each gotfocus, I revert the last control, colorize the new control, and save the new control as the one with focus. I even use a special color for required fields.
At 25 MAY 2005 03:16PM Casey Greenwood wrote:
Thanks Kevin – I'll give it a shot.