Hello fellow freaks!
I have a problem, which is as follows: I want to display a ListViewGadget, but it is larger than the window which it is assigned to. I would like the gadget to extend outside this window and the part that is outside the window should still be displayed instead of just being cropped.
Is there a way to do this? Searching these forums as well as the purearea.net code archive hasn't turned up anything.
Thanks for any help!!!
merendo
Displaying a gadget partially outside its window
Displaying a gadget partially outside its window
The truth is never confined to a single number - especially scientific truth!
Re: Displaying a gadget partially outside its window
merendo wrote:I want to display a ListViewGadget, but it is larger than the window which it is assigned to. I would like the gadget to extend outside this window and the part that is outside the window should still be displayed instead of just being cropped.
what exactly do you mean?Showing parts of the Gadget outside the Window, or be able to scroll inside the window to view the rest of the ListViewGadget()?
If you want the 2nd thing (scrolling within the Window), ScrollAreaGadget() is your fiend.
[Dynamic-Dialogs] - create complex GUIs the easy way
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
[DeFlicker] - easily deflicker your resizeable Windows
[WinFX] - Window Effects (incl. 'click-through' Window)
Re: Displaying a gadget partially outside its window
Hello merendo,
I'm also unsure if you want the impossible
Why not make the window resizable ?
or use tootips that exceed the window by themselfs ?
or make your ListView a separate childwindow ?
I'm also unsure if you want the impossible
Why not make the window resizable ?
or use tootips that exceed the window by themselfs ?
or make your ListView a separate childwindow ?
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi
Missing a download-file on the forums? ~ check out this backup page.
Missing a download-file on the forums? ~ check out this backup page.
Re: Displaying a gadget partially outside its window
Here's what I want:
But I would like the ListViewGadget to be fully visible, ie to extend outside the window boundaries. Right now, it's just being cropped. Is there a way to do this?
Code: Select all
If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 250, 200)
For a = 1 To 12
AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
Next
SetGadgetState(0, 9) ; set (beginning with 0) the tenth item as the active one
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
The truth is never confined to a single number - especially scientific truth!
- DoubleDutch
- Addict

- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: Displaying a gadget partially outside its window
You can't extend out of the window, but see PureLust's post:
That is a BIG clue on how to get pretty much what you want...If you want the 2nd thing (scrolling within the Window), ScrollAreaGadget() is your fiend.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
Re: Displaying a gadget partially outside its window
By far not perfect, but maybe it's enough for you to work with.
Code: Select all
OpenWindow(0, 0, 0, 270, 140, "Main", #PB_Window_SystemMenu)
ButtonGadget(0, 5, 5, 200, 50, "button")
OpenWindow(1, 100, 100, 250, 200, "", #PB_Window_BorderLess)
ListViewGadget(1, 0, 0, 250, 200)
For a=1 To 10
AddGadgetItem(1, 0, Str(a))
Next
Repeat
event = WaitWindowEvent(20)
Select event
Case #PB_Event_MoveWindow
If EventWindow()=0
ResizeWindow(1, WindowX(0)+100, WindowY(0)+100, #PB_Ignore, #PB_Ignore )
SetActiveWindow(1)
EndIf
Default
SetActiveWindow(1)
EndSelect
Until event=#PB_Event_CloseWindow
End Re: Displaying a gadget partially outside its window
Yes, that's how I've solved the problem now. I am still not entirely satisfied, as it creates a weird look when the parent window is moved, but I guess it'll have to do. Thanks for your code anyway.
The truth is never confined to a single number - especially scientific truth!
Re: Displaying a gadget partially outside its window
Hi Merendo:
With a callback you can avoid the weird look when the parent window is moved.
Cheers!
With a callback you can avoid the weird look when the parent window is moved.
Code: Select all
Procedure WinCB1(hWnd, Msg, wParam, lParam)
Select msg
Case #WM_MOVE,#WM_MOVING
If EventWindow()=0
ResizeWindow(1, WindowX(0)+120, WindowY(0)+50, #PB_Ignore, #PB_Ignore )
EndIf
Default
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
OpenWindow(0, 0, 0, 270, 60, "Main", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
BtnShowHide=ButtonGadget(-1, 5, 5, 100, 20, "Show Gad",#PB_Button_Toggle)
BtnClose=ButtonGadget(-1, 5, 35, 100, 20, "Quit")
OpenWindow(1, WindowX(0)+120, WindowY(0)+50, 250, 200, "", #PB_Window_BorderLess|#PB_Window_Invisible)
StickyWindow(1,1)
ListViewGadget(1, 0, 0, 250, 200)
For a=1 To 10
AddGadgetItem(1, 0, Str(a))
Next
SetWindowCallback(@WinCb1())
Repeat
If GetAsyncKeyState_(27)&$8000 : End : EndIf
ev = WaitWindowEvent(1)
Select ev
Case #PB_Event_Gadget
Select EventGadget()
Case BtnClose:Break
Case BtnShowHide
HideWindow(1, GetGadgetState(BtnShowHide)!1)
EndSelect
EndSelect
Until ev=#PB_Event_CloseWindow
End 