home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!world!yon
- From: yon@world.std.com (David A Yon)
- Subject: EnableKBHandler in TPW? Help!
- Message-ID: <BtyA7F.E7w@world.std.com>
- Followup-To: comp.os.ms-windows.programmer.misc
- Organization: The World Public Access UNIX, Brookline, MA
- Date: Wed, 2 Sep 1992 12:18:50 GMT
- Lines: 89
-
- I'm running TPW 1.5 under Win 3.1, and can't seem to get the
- ObjectWindows EnableKBHandler feature to work. I've got a resizable
- window under MDI where I have two comboboxes, a single-line edit, and
- a multi-line edit control. I've tried calling EnableKBHandler in both
- the Init and SetupWindow methods, all to no avail. Anytime I hit
- <tab> in the window the computer just beeps. I realize the that the
- multi-line edit is a wrench in the works, but I don't really care
- whether or not you can tab out of that control anyway. I just want to
- be able to traverse the other controls. Any help appreciated!
-
- David Yon
- yon@world.std.com
-
- The Init and SetupWindow methods follow. Note that I am specifying
- ws_TabStop and ws_Group for the four controls that I want to traverse:
-
-
- {**
- ** Init -- This method initializes each instance of the
- ** TLetterEditor class.
- **}
- constructor TLetterEditor.Init(AParent: PWindowsObject;
- owner: PLetter);
- const
- LineHeight = 30;
-
- begin
- TLetterWindow.Init(AParent,owner);
- EnableKBHandler;
- Contents^.Attr.Style := Contents^.Attr.Style and
- not (es_AutoHScroll or ws_HScroll);
-
- EnableTransfer;
-
- {--- Set up Controls ---}
- with DestinationSize do
- Destination := New(PComboBox, Init(@Self,
- id_LetterEditorDestination, X,Y,W,H,
- cbs_DropDown or cbs_HasStrings or cbs_AutoHScroll, 81));
- Destination^.Attr.Style := Destination^.Attr.Style or
- ws_TabStop or ws_Group;
- with InfoDestSize do
- InfoDest := New(PComboBox, Init(@Self,
- id_LetterEditorServ,X,Y,W,H,
- cbs_DropDownList or cbs_HasStrings or cbs_AutoHScroll, 81));
- InfoDest^.Attr.Style := InfoDest^.Attr.Style or
- ws_TabStop or ws_Group;
- with SubjectSize do
- Subject := New(PEdit, Init(@Self, id_LetterEditorSubject,
- '',X,Y,W,H, 40, False));
- Subject^.Attr.Style := Subject^.Attr.Style or
- ws_TabStop or ws_Group;
- end;
-
-
- {**
- ** SetupWindow -- This method installs widgets for the Lettor Editor;
- **}
- procedure TLetterEditor.SetupWindow;
- var
- Msg: TMessage;
- begin
- EnableKBHandler;
- Dirty := False;
-
- {--- Enable transferring of Data to and from the Destination,
- Subject, and Contents ---}
- Destination^.EnableTransfer;
- InfoDest^.EnableTransfer;
- Subject^.EnableTransfer;
- TLetterWindow.SetupWindow;
-
- {--- Enable Soft Line-Breaks ---}
- SendMessage(Contents^.HWindow,em_GetRect,0,Longint(@FmtRect));
- with FmtRect do
- begin
- Left := 0; Top := 0;
- end;
- SendMessage(Contents^.HWindow,wm_SetFont,
- GetStockObject(SYSTEM_FIXED_FONT),0);
- SendMessage(Subject^.HWindow,wm_SetFont,
- GetStockObject(SYSTEM_FIXED_FONT),0);
- Contents^.SetText(ownedBy^.GetBody);
- SetFocus(Destination^.HWindow);
- end;
-
-
-
-
-