| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Delphi: Общие вопросы > Оконное приложение |
| Автор: man2002ua 29.10.2003, 10:56 |
| 1) Существует основное окно приложения MAIN с двумя пунктами меню M1 и М2; 2) на щелчок на пункт М1 показывается окно WIN1, на пункт М2 - WIN2; - возможно переключение между WIN1 и WIN2 3) на WIN1 - есть кнопка, по которой открывается окно WIN11 (модальное для WIN1) - ТЕПЕРЬ ВАЖНО: хочу добиться, чтобы переключение между WIN11 и WIN2 было возможным и при этом между WIN1 и WIN11 - нет. - и чтобы была возможность выбирать пункты меню окна MAIN Пробовал, не получается - никогда такого не делал (только в Clarione)... хелп :-( |
| Автор: SmaLL 29.10.2003, 11:07 |
| Тоже такого не делал, но есть вариант, можешь попробовать WIN11 не как модальное, а как обычное окно, но в WIN1 в событии OnActivate (может ещЁ в каком-то) выводить наверх WIN11 если оно было открыто. Надеюсь мысль ясна. |
| Автор: man2002ua 29.10.2003, 11:12 |
| мысль ясна, но хотелось бы послушать и др. варианты |
| Автор: <Spawn> 29.10.2003, 11:15 |
| man2002ua есть вариант такой - на OnCreate WIN11 ставь EnableWindow(WIN1.Handle, False), на закрытие EnableWindow(Form2.Handle, True). (За место его модальности) |
| Автор: man2002ua 29.10.2003, 11:29 |
| SmaLL, в твоем варианте окно WIN1 можно будет двигать, так что вариант <Spawn> наиболее соотв. нуждам. Спасибо всем! |
| Автор: AntonSaburov 29.10.2003, 15:31 |
| Хорошо помню, что можно было окно сделать неактивным. Вот, нашел. Посмотри. Можно этим поиграть. Message WS_DISABLED. Disabled Windows A window can be disabled. A disabled window receives no keyboard or mouse input from the user, but it can receive messages from other windows, from other applications, and from the system. An application typically disables a window to prevent the user from using the window. For example, an application may disable a push button in a dialog box to prevent the user from choosing it. An application can enable a disabled window at any time; enabling a window restores normal input. By default, a window is enabled when created. An application can specify the WS_DISABLED style, however, to disable a new window. An application enables or disables an existing window by using the EnableWindow function. The system sends a WM_ENABLE message to a window when its enabled state is about to change. An application can determine whether a window is enabled by using the IsWindowEnabled function. When a child window is disabled, the system passes the child's mouse input messages to the parent window. The parent uses the messages to determine whether to enable the child window. For more information, see Mouse Input. Only one window at a time can receive keyboard input; that window is said to have the keyboard focus. If an application uses the EnableWindow function to disable a keyboard-focus window, the window loses the keyboard focus in addition to being disabled. EnableWindow then sets the keyboard focus to NULL, meaning no window has the focus. If a child window, or other descendant window, has the keyboard focus, the descendant window loses the focus when the parent window is disabled. For more information, see Keyboard Input. |
| Автор: man2002ua 29.10.2003, 16:43 |
| AntonSaburov, дык, это то же самое, что <Spawn> предложил... |