Panelgadgets and Frame3DGadgets

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.

Hi,

Is there some way to change the frame on a PanelGadget (without resorting to direct OS functions)? I have looked, but can't find anything.

Alternatively, is there a (preferrably non-OS) way to get Frame3DGadget's to go behind other gadgets? I realise that they are probably just drawn with boxes and lines, but if I create a Frame3DGadget and then another gadget (which is positioned to be inside it) sometime later, the Frame3DGadget looks like it is drawn last, covering the other gadgets. Reversing the order the gadgets are created has no effect.

I suppose I'll end up having to write my own Frame3DGadget drawing routine (blegh :wink:.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

Hi tinman,

Could you post some code that shows Frame3DGadget's not working. I use them quite a bit and have never had any problems. Maybe you are missing something?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by El_Choni.
Is there some way to change the frame on a PanelGadget (without resorting to direct OS functions)? I have looked, but can't find anything.

Code: Select all

Result = SetGadgetState(#Gadget, State)
SetGadgetState is used for that AFAIK. Bye,

El_Choni
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
Could you post some code that shows Frame3DGadget's not working. I use them quite a bit and have never had any problems. Maybe you are missing something?
I went to create a small test prog to send here, and it works fine, so I guess I got something wrong in my main code. Thanks for the push though.

El_Choni - SetGadgetState doesn't change the panelgadget frames as far as I can see. I tried a few different values (same values as Frame3DGadget and some other random value) and it always shows a double sticking out frame.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Paul.

SetGadgetState() is used to display a specific panel, not change the properties of it.

For example, if you have 3 tabs on the panel (0,1,2), SetGadgetState(#panel,2) will force the 3rd one to be displayed.

I think tinman is talking about changing the Tab Control Styles, like putting the tabs on the bottom instead of the top which is the default. Of course you are looking at API specific stuff now.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tinman.
I think tinman is talking about changing the Tab Control Styles, like putting the tabs on the bottom instead of the top which is the default. Of course you are looking at API specific stuff now.
No, I was talking about changing the colour of the frame - it seems I had misunderstood what panel gadgets were for, as I did not realise it had anything to do with tab pages (great description in the PB manual :/ ).

OK, so now I know I should definately be using frame gadgets (as I really do only want a frame round them), and I now have some code which shows the bugs I mentioned:

Code: Select all

If Initgadget(10)=0 : End : EndIf

If OpenWindow(0, 100, 300, 500, 300, #PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget|#PB_Window_SizeGadget, "Layout Test")

    If CreateGadgetList(WindowID())
        PanelGadget(0, 0, 0, 150, 60)
        ButtonGadget(1, 10, 10, 100, 20, "??")
        ClosePanelGadget()
        
        Frame3DGadget(2, 160, 0, 90, 60, "", 0)
        Frame3DGadget(3, 260, 0, 90, 60, "", 1)
        Frame3DGadget(4, 360, 0, 90, 60, "", 2)
        
        ButtonGadget(5, 166, 6, 78, 20, "A")
        ButtonGadget(6, 266, 6, 78, 20, "B")
        ButtonGadget(7, 366, 6, 78, 20, "C")
    EndIf

    StartDrawing(WindowOutput())
    FrontColor(255, 0, 0)
    Line(0, 0, 500, 0)
    StopDrawing()

    ; Main window loop
    quit.w=0
    While quit=0
        ev.l=WaitWindowEvent()
        Select ev
            Case #PB_EventCloseWindow
                quit=1
            Case #PB_EventRepaint
    StartDrawing(WindowOutput())
    FrontColor(255, 0, 0)
    Line(0, 0, 500, 0)
    StopDrawing()
            
        EndSelect
    Wend

    CloseWindow(0)
EndIf
End
The buttons shows in the first frame (normal edges) but not in the second or third (double and single sunken respectively). I don't see why my code would be broken, since it works for the first frame.

Also, the normal frame's top edge is drawn six pixels below the position I specify. There's a screengrab on my homepage http://www.david-mcminn.co.uk

This is all in Win98.


--
It's not minimalist - I'm increasing efficiency by reducing input effort.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Hi-Toro.

I noticed the same problem with Frame3DGadgets -- they always appear in front of all other gadgets, making them hidden. I assumed I was just using them for the wrong purpose, but I thought they were meant to provide a frame for other gadgets?


--
See ya,
James L Boyd.
http://www.hi-toro.com/
--
Post Reply