Page 1 of 1

image backgrounds killing my buttons and web page...

Posted: Wed May 25, 2005 6:54 am
by kane
My problem is when minimize or like have window overtop then go back my program buttons webpage missing I click around till I find the buttons it's like picture glitches over it..

Code: Select all

;================= Window 0(Start) (Main) ==================
Procedure Open_Window_0()
  If OpenWindow(#Window_0, 302, 537, 750, 375,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "PlanetL2 24/7 Server Launcher. (Ver 1.0)")
    If CreateGadgetList(WindowID())
      WebGadget(#Web_0, 20, 20, 610, 340, "about:blank")
      ButtonGadget(#Button_0, 650, 330, 80, 30, "Exit")
      GadgetToolTip(#Button_0, "To Exit the launcher.")
      ButtonGadget(#Button_1, 650, 250, 80, 30, "Support")
      GadgetToolTip(#Button_1, "If you have a problem or a complaint.")
      ButtonGadget(#Button_2, 650, 210, 80, 30, "FAQ's")
      GadgetToolTip(#Button_2, "Frequently Asked Questions- We give the answers.")
      ButtonGadget(#Button_3, 650, 170, 80, 30, "Extra")
      GadgetToolTip(#Button_3, "Extra Content.")
      ButtonGadget(#Button_4, 650, 290, 80, 30, "About")
      GadgetToolTip(#Button_4, "About our servers and us.")
      ButtonGadget(#Button_5, 650, 130, 80, 30, "Forums")
      GadgetToolTip(#Button_5, "Server forums.")
      ButtonGadget(#Button_6, 650, 90, 80, 30, "Chat")
      GadgetToolTip(#Button_6, "Live php chat with other players.")
      ButtonGadget(#Button_7, 650, 50, 80, 30, "Updates")
      GadgetToolTip(#Button_7, "Check for the latest updates. (Use this when the launchers out of date.)")
      ButtonGadget(#Button_8, 650, 10, 80, 30, "Play")
      GadgetToolTip(#Button_8, "Play PlanetL2 Now!")
      ImageGadget(#Image_0, 0, 0, 750, 375, Image0)
      
    EndIf
  EndIf
EndProcedure
;================= Window 0(Stop) (Main) ==================
also is it possible get the image show in background too from the browser part.?

Posted: Wed May 25, 2005 5:27 pm
by kane
bump

Posted: Wed May 25, 2005 5:49 pm
by El_Choni
There's an empty image gadget covering the entire window, or so it seems; I think this could cause trouble.

Posted: Wed May 25, 2005 5:58 pm
by kane
ImageGadget(#Image_0, 0, 0, 750, 375, Image0) ?

I got info for that:

Code: Select all

;- Image Plugins
UseJPEGImageDecoder()

;- Image Globals
Global Image0
Global Image1

;- Catch Images
Image0 = CatchImage(0, ?Image0)
Image1 = CatchImage(1, ?Image1)

;- Images
DataSection
Image0:
IncludeBinary "G:\Documents and Settings\Kane\Desktop\PLANETL2 EVERYTHING\launcher\source\Untitled-2.jpg"
Image1:
IncludeBinary "G:\Documents and Settings\Kane\Desktop\PLANETL2 EVERYTHING\launcher\source\Untitled-3.jpg"
EndDataSection


Posted: Wed May 25, 2005 6:30 pm
by Sparkie
Either of these should work.

Place this line after you create your ImageGadget.

Code: Select all

SetWindowLong_(GadgetID(#Image_0), #GWL_STYLE, GetWindowLong_(GadgetID(#Image_0), #GWL_STYLE) | #WS_CLIPSIBLINGS)

Or remove your ImageGadget and use CreateBrushIndirect_() API using your image as the source. You then use the brush for your window background.

Code: Select all

brushImage = LoadImage(0, "Path_to_your_image")
logB.LOGBRUSH
logB\lbStyle = #BS_PATTERN
logB\lbColor = #DIB_RGB_COLORS
logB\lbHatch = brushImage
myBrush = CreateBrushIndirect_(logB)
Global myBrush
Then in your Open_Window_0() procedure, add this after creating the window.

Code: Select all

SetClassLong_(WindowID(), #GCL_HBRBACKGROUND, myBrush)
Don't forget to

Code: Select all

DeleteObject_(myBrush)
when your done.

Posted: Wed May 25, 2005 8:03 pm
by kane
Don't know if I did right but not lossing buttons anymore hehe thanks..

Code: Select all

      ImageGadget(#Image_0, 0, 0, 750, 375, Image0)
      SetWindowLong_(GadgetID(#Image_0), #GWL_STYLE, GetWindowLong_(GadgetID(#Image_0), #GWL_STYLE) | #WS_CLIPSIBLINGS)

Posted: Wed May 25, 2005 8:42 pm
by Sparkie
@kane: Try this one. Just be sure to enter the path to your image on line 19. I think using a window background may be a little more efficient than placing gadgets on top of gadgets. ;)

Code: Select all

UseJPEGImageDecoder()
Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Web_0
  #Button_0
  #Button_1
  #Button_2
  #Button_3
  #Button_4
  #Button_5
  #Button_6
  #Button_7
  #Button_8
  #Image_0
EndEnumeration
; --> Enter the path to your image
brushImage = LoadImage(0, "Path_to_your_image")
myBrush = CreatePatternBrush_(brushImage)
Global myBrush
;================= Window 0(Start) (Main) ================== 
Procedure Open_Window_0() 
  If OpenWindow(#Window_0, 302, 537, 750, 375,  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "PlanetL2 24/7 Server Launcher. (Ver 1.0)") 
    SetClassLong_(WindowID(), #GCL_HBRBACKGROUND, myBrush)
    If CreateGadgetList(WindowID()) 
      WebGadget(#Web_0, 20, 20, 610, 340, "about:blank") 
      ButtonGadget(#Button_0, 650, 330, 80, 30, "Exit") 
      GadgetToolTip(#Button_0, "To Exit the launcher.") 
      ButtonGadget(#Button_1, 650, 250, 80, 30, "Support") 
      GadgetToolTip(#Button_1, "If you have a problem or a complaint.") 
      ButtonGadget(#Button_2, 650, 210, 80, 30, "FAQ's") 
      GadgetToolTip(#Button_2, "Frequently Asked Questions- We give the answers.") 
      ButtonGadget(#Button_3, 650, 170, 80, 30, "Extra") 
      GadgetToolTip(#Button_3, "Extra Content.") 
      ButtonGadget(#Button_4, 650, 290, 80, 30, "About") 
      GadgetToolTip(#Button_4, "About our servers and us.") 
      ButtonGadget(#Button_5, 650, 130, 80, 30, "Forums") 
      GadgetToolTip(#Button_5, "Server forums.") 
      ButtonGadget(#Button_6, 650, 90, 80, 30, "Chat") 
      GadgetToolTip(#Button_6, "Live php chat with other players.") 
      ButtonGadget(#Button_7, 650, 50, 80, 30, "Updates") 
      GadgetToolTip(#Button_7, "Check for the latest updates. (Use this when the launchers out of date.)") 
      ButtonGadget(#Button_8, 650, 10, 80, 30, "Play") 
      GadgetToolTip(#Button_8, "Play PlanetL2 Now!") 
    EndIf 
  EndIf 
EndProcedure 
;================= Window 0(Stop) (Main) ==================
Open_Window_0()
Repeat
  event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
DeleteObject_(myBrush)
End

Posted: Wed May 25, 2005 10:01 pm
by Paul
Or give PureVisionXP a try for Form Design :D

Posted: Thu May 26, 2005 3:44 am
by kane
Paul wrote:Or give PureVisionXP a try for Form Design :D
I would if I had the deep pocket for it.. For learning and fun so rather go the cheaper route... If you know of a free type form design program I'm willing to try out.. Be nice get one make like I do websites hehe