static int AsciitabProc(WINDOW wnd,MESSAGE msg, PARAM p1,PARAM p2) { switch (msg) { case CREATE_WINDOW: DefaultWndProc(wnd, msg, p1, p2); CreateWindowMsg(wnd); return TRUE; case KEYBOARD: if (KeyboardMsg(wnd, p1)) return TRUE; break; case PAINT: DefaultWndProc(wnd, msg, p1, p2); DisplayAsciitab(wnd); return TRUE; case COMMAND: if ((int)p1 == ID_HELP) { DisplayHelp(wnd, "ASCII Table"); return TRUE; } break; case CLOSE_WINDOW: ATwnd = NULL; break; default: break; } return DefaultWndProc(wnd, msg, p1, p2); }
/* ------- Window processing module for EDITBOX class ------ */ int EditBoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2) { int rtn; switch (msg) { case CREATE_WINDOW: return CreateWindowMsg(wnd); case ADDTEXT: return AddTextMsg(wnd, p1, p2); case SETTEXT: return SetTextMsg(wnd, p1); case CLEARTEXT: return ClearTextMsg(wnd); case GETTEXT: return GetTextMsg(wnd, p1, p2); case SETTEXTLENGTH: return SetTextLengthMsg(wnd, (unsigned) p1); case KEYBOARD_CURSOR: KeyboardCursorMsg(wnd, p1, p2); return TRUE; case SETFOCUS: if (!(int)p1) SendMessage(NULL, HIDE_CURSOR, 0, 0); case PAINT: case MOVE: rtn = BaseWndProc(EDITBOX, wnd, msg, p1, p2); SendMessage(wnd,KEYBOARD_CURSOR,WndCol,wnd->WndRow); return rtn; case SIZE: return SizeMsg(wnd, p1, p2); case SCROLL: return ScrollMsg(wnd, p1); case HORIZSCROLL: return HorizScrollMsg(wnd, p1); case SCROLLPAGE: return ScrollPageMsg(wnd, p1); case HORIZPAGE: return HorizPageMsg(wnd, p1); case LEFT_BUTTON: if (LeftButtonMsg(wnd, p1, p2)) return TRUE; break; case MOUSE_MOVED: if (MouseMovedMsg(wnd, p1, p2)) return TRUE; break; case BUTTON_RELEASED: if (ButtonReleasedMsg(wnd)) return TRUE; break; case KEYBOARD: if (KeyboardMsg(wnd, p1, p2)) return TRUE; break; case SHIFT_CHANGED: ShiftChangedMsg(wnd, p1); break; case COMMAND: if (CommandMsg(wnd, p1)) return TRUE; break; case CLOSE_WINDOW: return CloseWindowMsg(wnd, p1, p2); default: break; } return BaseWndProc(EDITBOX, wnd, msg, p1, p2); }