|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
Возможно ли просто сделать response! окно ресайзовым? ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 08:17 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
ГеннадичВозможно ли просто сделать response! окно ресайзовым? Вот так примерно: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20.
... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 10:12 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
А вот так без PFC: $PBExportHeader$w_response_szgrip.srw forward global type w_response_szgrip from window end type type sizegrip from hscrollbar within w_response_szgrip end type type point from structure within w_response_szgrip end type type minmaxinfo from structure within w_response_szgrip end type end forward type point from structure long x long y end type type minmaxinfo from structure point ptreserved point ptmaxsize point ptmaxposition point ptmintracksize point ptmaxtracksize end type global type w_response_szgrip from window integer x = 672 integer y = 268 integer width = 1810 integer height = 1324 boolean titlebar = true string title = "Resizeable Response Window with a Sizegrip" windowtype windowtype = response! long backcolor = 79741120 event wm_minmaxinfo pbm_getminmaxinfo sizegrip sizegrip end type global w_response_szgrip w_response_szgrip type prototypes Function long GetWindowLongA (long hWindow, integer nIndex) Library "user32.dll" Function long SetWindowLongA (long hWindow, integer nIndex, long dwNewLong) Library "user32.dll" subroutine GetMinMaxInfo ( ref minmaxinfo d, long s, long l ) library 'kernel32.dll' alias for RtlMoveMemory subroutine SetMinMaxInfo ( long d, minmaxinfo s, long l ) library 'kernel32.dll' alias for RtlMoveMemory FUNCTION ulong GetSystemMenu(ulong hWnd, BOOLEAN bRevert) Library "USER32" FUNCTION boolean DeleteMenu( ulong hMenu, uint uPosition, uint uFlags ) LIBRARY "user32.dll" FUNCTION boolean DrawMenuBar( ulong hWnd ) LIBRARY "user32.dll" FUNCTION int GetSystemMetrics(integer nIndex) LIBRARY "user32.dll" //.................. Winapi for disable X button ......................... Function Long GetSystemMenu( uLong hwnd, Long bRevert ) Library "user32.dll" Function Long RemoveMenu( uLong hMenu, Long nPosition, Long wFlags ) Library "user32.dll" // end prototypes type variables protected: CONSTANT int SM_CXVSCROLL = 2 CONSTANT int SM_CYHSCROLL = 3 CONSTANT int SM_CXHSCROLL = 21 CONSTANT int SM_CYVSCROLL = 20 CONSTANT int SBS_SIZEGRIP = 16 CONSTANT int GWL_STYLE = -16 CONSTANT long WS_THICKFRAME = 262144 CONSTANT long WS_SYSMENU = 524288 CONSTANT uint SC_SIZE = 61440 CONSTANT uint SC_MOVE = 61456 CONSTANT uint SC_MINIMIZE = 61472 CONSTANT uint SC_MAXIMIZE = 61488 CONSTANT uint SC_CLOSE = 61536 CONSTANT uint SC_RESTORE = 61728 CONSTANT uint MF_BYCOMMAND = 0 long il_orig_width, il_orig_height BOOLEAN isCloseButton = true private: boolean ib_show_szgrip end variables forward prototypes protected subroutine wf_set_orig_size () private subroutine wf_set_systemmenu () end prototypes event wm_minmaxinfo;/*------------------------------------------------------------------------------ Object: w_response_szgrip Event : wm_Minmaxinfo Parameters: long minmaxinfo Returns: long Copyright й 1999 Philip Salgannik Date Created: 04/10/99 Description: -------------------------------------------------------------------------------- Modifications: Date Author Comments ------------------------------------------------------------------------------*/ IF il_orig_width < 1 OR il_orig_height < 1 THEN RETURN MinMaxInfo lstr_MinMaxInfo /* copy the data, pointed by the argument MinMaxInfo, to our lstr_MinMaxInfo structure */ GetMinMaxInfo(lstr_MinMaxInfo, MinMaxInfo, 40) /* set the minimal size for our window */ lstr_MinMaxInfo.ptMinTrackSize.x = UnitsToPixels(il_orig_width, XUnitsToPixels!) lstr_MinMaxInfo.ptMinTrackSize.y = UnitsToPixels(il_orig_height, YUnitsToPixels!) /* copy the structure back into memory at the same place */ SetMinMaxInfo(MinMaxInfo,lstr_MinMaxInfo,40) /* important, according to the MS API, we must return 0 */ return 0 end event protected subroutine wf_set_orig_size ();/*------------------------------------------------------------------------------ Object: w_response_szgrip Function: protected wf_Set_orig_size Parameters: Returns: (None) Copyright й 1999 Philip Salgannik Date Created: 03/19/99 Description: This will set instance variables for minimum size of the window override on descendants to customize -------------------------------------------------------------------------------- Modifications: Date Author Comments ------------------------------------------------------------------------------*/ il_orig_width = width il_orig_height = height end subroutine private subroutine wf_set_systemmenu ();/*------------------------------------------------------------------------------ Object: w_response_szgrip Function: private wf_Set_systemmenu Parameters: Returns: (None) Copyright й 1999 Philip Salgannik Date Created: 03/29/99 Description: -------------------------------------------------------------------------------- Modifications: Date Author Comments ------------------------------------------------------------------------------*/ // Get the window's menu ULong hMenu, hWnd hWnd = Handle( this ) hMenu = GetSystemMenu( hWnd, FALSE ) IF hMenu > 0 THEN // removing the menu items from the system menu DeleteMenu( hMenu, SC_MINIMIZE , MF_BYCOMMAND) DeleteMenu( hMenu, SC_MAXIMIZE , MF_BYCOMMAND) DeleteMenu( hMenu, SC_RESTORE , MF_BYCOMMAND) IF not this.isclosebutton THEN DeleteMenu( hMenu, SC_CLOSE , MF_BYCOMMAND) // Force immediate menu update DrawMenuBar( hWnd ) END IF end subroutine on w_response_szgrip.create this.sizegrip=create sizegrip this.Control[]={this.sizegrip} end on on w_response_szgrip.destroy destroy(this.sizegrip) end on event open;/*------------------------------------------------------------------------------ Object: w_response_szgrip Event : Open Parameters: Returns: long Copyright й 1999 Philip Salgannik Date Created: 04/15/99 Description: -------------------------------------------------------------------------------- Modifications: Date Author Comments ------------------------------------------------------------------------------*/ wf_Set_orig_size() ulong ll_style ll_style = GetWindowLongA(handle(this), gwl_style) IF ll_style <> 0 THEN IF SetWindowLongA(handle(this), gwl_style, ll_style + WS_THICKFRAME + WS_SYSMENU) <> 0 THEN wf_Set_systemmenu() ib_show_szgrip = TRUE END IF END IF end event event resize; integer li_height, li_width sizegrip.Move(newwidth - sizegrip.width, newheight - sizegrip.height) IF NOT sizegrip.visible AND ib_show_szgrip THEN sizegrip.Show() end event event activate;picturebutton pb integer n,nn nn = upperbound(this.control ) for n = 1 to nn if this.control[n].typeof() = picturebutton! then pb = this.control[n] pb.enabled = pb.enabled end if next return 0 end event type sizegrip from hscrollbar within w_response_szgrip boolean visible = false integer x = 1755 integer y = 1192 integer width = 50 integer height = 64 boolean stdheight = false end type event constructor;ulong ll_style ll_style = GetWindowLongA(handle(this), gwl_style) IF ll_style <> 0 THEN IF SetWindowLongA(handle(this), gwl_style, ll_style + SBS_SIZEGRIP) <> 0 THEN width = (PixelsToUnits( GetSystemMetrics( SM_CXHSCROLL ) , XPixelsToUnits! ) ) height = (PixelsToUnits( GetSystemMetrics( SM_CYHSCROLL ), YPixelsToUnits! ) ) END IF END IF end event ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 15:27 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
PaulJB А вот так без PFC: Ну чтобы в том примере от PFC избавится достаточно вызов of_BitWiseOr изменить на банальное сложение :) ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 15:42 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
Э, Марк, если в том примере просто убрать of_BitWiseOr , то в отличие от моего , sizegrip в нём всё равно не появится :-) ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 16:54 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
ФилиппЭ, Марк, если в том примере просто убрать of_BitWiseOr, то в отличие от моего, sizegrip в нём всё равно не появится :-) Но хуже от этого тот пример работать не станет? :) ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 17:10 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
Марк, работать будет хуже, по той простой причине, что так называемый affordance будет меньше - визуальных ключей, намекающих на то, что окно resizeable будет меньше... ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 18:33 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
Кроме того, и системное меню будет неправильное... ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 18:35 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
>>Возможно ли просто сделать response! окно ресайзовым? Есть еще один способ: 1. Создать response окно - со свойством visible = 0 2. На openе вызвать свое событие :This. Post Event ue_open_next() 3. А из этого события вызвать окно - имеющее свойство resize. У нас это Response окно открывает несколько окон, в зависимости от переданного параметра - вполне удобно. Гость. ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 18:36 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
proba , и что же это извращение даёт? ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 18:52 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
Филипп, не спорю, просто то был способ отвязки от PFC... ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 19:10 |
|
Сделать response! окно ресайзовым
|
|||
---|---|---|---|
#18+
>>proba, и что же это извращение даёт? При WindowState = maximized! вызываемое окно ( например popup!) ресайзится как ему и полагается, однако перейти на другое открытое окно ты не можешь, пока не закроешь его, т.е. оно имеет свойство респонсного. Только при закрытии окна последнего надо не забыть заодно закрыть и респонс. Гость. ... |
|||
:
Нравится:
Не нравится:
|
|||
12.07.2004, 20:50 |
|
|
start [/forum/topic.php?fid=15&fpage=102&tid=1339022]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
31ms |
get topic data: |
12ms |
get forum data: |
2ms |
get page messages: |
96ms |
get tp. blocked users: |
1ms |
others: | 11ms |
total: | 184ms |
0 / 0 |