Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности
|
|
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
В windows если одно немодальное окно распахнуть (wsMaximized), то все остальные немодальные окна тоже становятся распахнутым. А в 1C такое не наблюдается. Есть ли какой-то готовый обработчик окон с подобной технологией? Чтобы не изобретать самому. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.10.2011, 19:09 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
demav... А в 1C такое не наблюдается. ... Вы уверены? в 1С v7.7 точно наблюдается. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 11:45 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
В восьмерке - раздельная максимизация. Самого интересует, как это сделать. Где-то находил информацию, что 1С сделала собственную реализацию MDI-интерфейса. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 13:01 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
CyberMax, в базовой дочерней форме: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. в главной MDI форме: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 13:25 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
если решите сами делать, может пригодиться: Simulating MDI without MDI OverheadThe reason I bought Delphi in the first place was to make a Win95 version of my favorite file manager, XTree for Windows 2.0. I'd never programmed before and realized soon that such a project was beyond my abilities. Two years later I've tried again, and this time I got it done ( http://www.fyi.net/~abass/domino/free.htm if you're interested). One of the things I needed to to do was to get a MDI setup that didn't show scrollbars in the parent window if a child was moved partially 'offscreen.' The nature of MDI won't allow that, however. I also wanted to have the child's title bar and min/max buttons appear in the client area of the parent when the child was maximized, instead of having the titlebar disappear and the buttons appended below the parent's buttons. Again, not allowed with MDI. Then, while searching for something else, I stumbled across a great article and sample program that did it all. The author is Brendan Delumpa and he has a great site of Delphi tips at www.delumpa.com. Check it out. This particular article I didn't find at his site, however. It is instead at The Cobb Group's website (not reproduced here for fear of copyright problems :-) http://www.cobb.com/ddj/9704/ddj9741.htm. I recommend reading this article before you get going with the code below but I guess it isn't really necessary as the code does do all that you need and if you just use it as a base to build on, you'll get your desired results. Still, the article is a good read and details very well how Delumpa "Tricked Windows" into letting him do what he wanted. The downside? Well, there's a little work involved, and you'll be responsible for all other MDI niceties such as the Window Menu. But it can be done and it results in a pretty slick interface (look to DTree above, seriously). Below is the code for a 'parent' and 'child' form ala Brendan Delumpa. There are no controls on the child and only a "new child" button on the parent form so you can easily create them in Delphi and just drop this code into them. NOTE that this code will not get you everything you'll see in DTree; I put a whole lot of extra stuff in and around this base. THE CHILD FORM: {=========================================================== Copyright © 1997 Brendan V. Delumpa All Rights Reserved Program : Child Form Author : Brendan V. Delumpa Description : This is a demonstration of creating a pseudo-MDIChild form, without the MDI overhead or complexities. Everything you can do with a top-level form can be applied to this child form, which is actually not possible with a MDI application because of the child constraints. One thing that you should note. I've brute forced form activation here by sending WM_NCACTIVATE to change the color of an "active" child form's caption bar. This is Windows trickery at its best. In all actuality, none of the "child" forms is active, nor focused, even though they appear to be. Pretty neat, huh? ===========================================================} unit ChildFor; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, ComCtrls, StdCtrls; type TChildFrm = class(TForm) Label1: TLabel; private ChildHndl : THandle; protected procedure CreateParams(var Params : TCreateParams); override; procedure WndProc(var Msg : TMessage); override; procedure ActivateForm; virtual; public { Public declarations } end; var ChildFrm: TChildFrm; implementation uses Unit1; {$R *.DFM} {=========================================================== This procedure overrides the default CreateParams procedure to set the form up as a Child window. This is done through the Style param. Note that when you set a form to be a child, it cannot have WS_POPUP as a style parameter as well, so it's AND'ed out. Setting WndParent and Parent to Application.MainForm notifies Delphi and Windows respectively, of the relationship. ===========================================================} procedure TChildFrm.CreateParams(var Params : TCreateParams); begin inherited CreateParams(Params); with Params do begin {Set the child window's style - WS_CHILD is absolutely required but you can optionally set other flags as well.} Style := (Style OR WS_CHILD) AND (NOT WS_POPUP); {The following should be added to the line above if you want to make an expert form. AND (NOT WS_CAPTION) AND (NOT WS_THICKFRAME);} {Designate the child form's parent} WndParent := Application.MainForm.Handle; end; Parent := Application.MainForm; end; {=========================================================== WndProc is a wrapper for a Windows WindowProc which is the message dispatcher for all messages sent to a window. It's an ideal place to trap and process several messages in one fell swoop. This one little routine is responsible for making the form act like a MDIChild form, by trapping WM_CREATE, WM_LBUTTONDOWN, and WM_NCLBUTTONDOWN messages. What it does is it tricks Windows into thinking that the form is a top-level window by sending a WM_ACTIVATE message to. This essentially makes the form's caption turn to the default Active form color. Then the call is made to ActivateForm to make all the other "Child" windows of the same class inactive. ===========================================================} procedure TChildFrm.WndProc(var Msg : TMessage); begin {Call the default Window procedure so all default actions are taken on all messages} inherited WndProc(Msg); {If the following occur, take further action} if (Msg.Msg = WM_CREATE) OR {window create} (Msg.Msg = WM_LBUTTONDOWN) OR {left-click in client area} (Msg.Msg = WM_RBUTTONDOWN) OR {right-click in client area} (Msg.Msg = WM_NCLBUTTONDOWN) OR {left-click in non-client area} (Msg.Msg = WM_NCRBUTTONDOWN) then{right-click in non-client area} begin {"Trick" Windows into thinking this is an active, top-level form.} Perform(WM_NCACTIVATE, Ord(True), 0); {Change all other forms of the same class to look inactive.} ActivateForm; end end; {=========================================================== ActivateForm is the workhorse for WndProc. I probably could have embedded this code in WndProc itself, but thought the better of it since I wanted WndProc to maintain its identity as a dispatcher. This procedure first assigns an interface (therefore global) variable the value of the current form's handle, then iterates through all the forms on the screen using the Screen global variable Forms property. If it finds a form of the same class as the current form, it checks to see if its handle is equal to the value of the global variable. If it's not, then WM_NCACTIVATE is sent with a wParam of false to make the form "inactive." This is actually necessary because the dispatcher sets the form to "active" and it will stay that way regardless of focus. So I needed to find a way to "inactivate" the other forms of the same class. ==========================================================} procedure TChildFrm.ActivateForm; var I : Integer; begin inherited; {Set the private ChildHndl variable to Self.Handle, so we know which form is active} ChildHndl := Self.Handle; Self.BringToFront; {I use the red code instead of Delumpa's blue code below. My code deactivates ALL other forms except for the 'parent' form.} for i := 0 to screen.formcount -1 do if (screen.Forms[i].ClassName <> parentfor.ClassName) then SendMessage(screen.Forms[i].Handle, WM_NCACTIVATE, Ord(False), 0); with Screen do begin {Go through all the forms on screen.} for I := 0 to FormCount - 1 do if (Forms[I].ClassName = Self.ClassName) then if (Forms[I].Handle <> ChildHndl) then {If a "Child" is of the same type, but not the current one, as specified by ChildHndl then make it inactive} SendMessage(Forms[I].Handle, WM_NCACTIVATE, Ord(False), 0); end; end; end. THE PARENT FORM: unit Parentfor; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TParentFrm = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var ParentFrm: TParentFrm; implementation uses ChildFor; {$R *.DFM} procedure TParentFrm.Button1Click(Sender: TObject); var frm : TChildFrm; begin frm := TChildFrm.Create(Application); with frm do begin Left := 50; Top := 50; Show; end; end; end. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 14:09 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
сорри, про тег SRC забыл Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. 179. 180. 181. 182. 183. 184. 185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 14:33 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
CyberMaxВ восьмерке - раздельная максимизация. Самого интересует, как это сделать. Где-то находил информацию, что 1С сделала собственную реализацию MDI-интерфейса. Где где? в Windows 8 ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 15:19 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Вау!!!CyberMaxВ восьмерке - раздельная максимизация. Самого интересует, как это сделать. Где-то находил информацию, что 1С сделала собственную реализацию MDI-интерфейса. Где где? в Windows 8 ? Евгений Ваганыч, у вас авторизация слетела. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 15:41 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Можно еще вот здесь посмотреть. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 11.10.2011, 18:41 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
demavВ windows если одно немодальное окно распахнуть (wsMaximized), то все остальные немодальные окна тоже становятся распахнутым. А в 1C такое не наблюдается. Есть ли какой-то готовый обработчик окон с подобной технологией? Чтобы не изобретать самому. А в 1С они вроде псевдомодальные. Я у себя использую MDIChild которые выглядят как модальные. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.10.2011, 09:56 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
DrMengeleА в 1С они вроде псевдомодальные.в 7-ке точно они псевдо т.к. позволяют кликать на приложение мимо себя ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 25.10.2011, 11:00 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Хорошо забытое старое. Увидел сейчас сам такое в 1С и стало прямо интересно. Собственная реализация MDI вообще сложное дело? Очень нравится сама идея с основным окном приложения, но не хочется использовать MDI (например, ограничения разные, да и просто отказ от поддержки). Чтобы также можно было свернуть, развернуть, минимизировать... Спасибо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 11:40 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
bzums Собственная реализация MDI вообще сложное дело? Зависит от версии VCL, в которой будете это делать. В последних мне делать не приходилось, но когда у GetParentForm появился второй аргумент - я понадеялся, что они разобрались хотя бы с частью глюков такого режима. А так - сделать-то не сложно, но в прежних версиях появлялось дикое количество артефактов, с которыми приходилось бороться. Например: у дочернего окна переставал отрисовываться active caption (оно было перманентно серым), отваливался вызов action-ов по горячим клавишам, отваливались хинты с контролов и т. д. и т. п. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 12:14 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Не думаю, что мне по плечу такое самому. Не занете ,есть модет какая-либо библитека / компонент? Или простенький пример использования? Спсибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 12:34 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
bzums, 1. пустой проект (TForm1). 2. создай в IDE форму (TForm2). 3. создание дочерней, как MDI: Код: pascal 1. 2. 3. 4. 5. 6. 7. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 14:23 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 14:25 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
DHDD, к сожалению в чайлдформе нет одной из самых полезных фич mdi: автоматического раскладывания плиткой/лестницей ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 14:57 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
makhaon, Код: pascal 1. 2. 3. 4. и так далее. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 16:13 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Код: pascal 1. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 16:15 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Я просто стал смотреть всякие лохматые примеры (реализованные еще лет 20 назад), один из них тут выше. Например, всякие компоненты типа MultiDoc, MultiFrame.... Ужас один. А тут получается все намного проще. А как тогда быть с поведением форм-детей, когда они: прилипают к краям и растягиваются вслед за формой-предком меню их пропадает (сливается) и появляется Спасибо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 16:29 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
bzums, прилипают к краям и растягиваются вслед за формой-предком меню их пропадает Код: pascal 1. 2. меню сливать тоже ручками прописать. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 16:48 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
makhaon к сожалению в чайлдформе нет одной из самых полезных фич mdi: автоматического раскладывания плиткой/лестницей Честно говоря, никогда не понимал полезности этих операций, но вот уж что делается за пять минут, так это как раз эти убер-фичи. P.S. Имхо, главная полезная фича - это window menu / mdi bar (и раскладывание лесенкой - просто неудачный паллиатив для этого). Иногда полезно деление экрана (либо половины экрана) между двумя-тремя окнами (и плитка - неудачный паллиатив для этого). Нередко хороша возможность прилепить окно к краю и сделать его неперекрываемым, то есть оставить для других окон оставшуюся область. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 18:00 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
softwarerглавная полезная фича - это window menu И это делается VCL вручную. Posted via ActualForum NNTP Server 1.5 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 18:02 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
Dimitry Sibiryakov softwarerглавная полезная фича - это window menu И это делается VCL вручную. Да всё псевдо-mdi легко делается вручную лучше, чем в дельфе и очень быстро. Как я уже сказал выше - вопрос только в том, чтобы это не вызывало глюков VCL. В пятой дельфе - не вызывало, было всё отлично. В 2007-й - пришлось убить изрядно времени на откровенно хакерские решения некоторых проблем (ну то есть некоторые - решались только патчем кода VCL в оперативной памяти). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 18:04 |
|
||
|
поведение немодальных окон как в 1С
|
|||
|---|---|---|---|
|
#18+
авторДа всё псевдо-mdi легко делается вручную лучше, чем в дельфе и очень быстро. авторИ это делается VCL вручную. Я уже потерял понимание того, как и что и где делается. В Дельфи, вручную в VCL.... Поясните пожалуйста. В принципе меня такое решение удовлетворяет, ещё бы закладки добавить или какое-то подобие вкладок. Ну может доступ к дочерние формам, счётчик, ну и такое. Как интересно будет вести себя Showmodal? Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 05.11.2021, 18:20 |
|
||
|
|

start [/forum/topic.php?fid=58&startmsg=37476143&tid=2036864]: |
0ms |
get settings: |
11ms |
get forum list: |
13ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
72ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
55ms |
get tp. blocked users: |
2ms |
| others: | 10ms |
| total: | 182ms |

| 0 / 0 |
