Page 46 of 71

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Fri Feb 10, 2012 11:59 pm
by ruslanx
Hi PrincieD, how can I change background color of a string gadget ...SetGadgetColor not working ... ??~!

from 'PreferencesExample.pb' :

Code: Select all

  ;/ connection pannel
  window = AddPanelExImagePage(0, image(5)\normal, 0, 0, 0, 0, #PNLX_CENTRE|#PNLX_VCENTRE)
  TextControlEx(window, #TextControl_1, 2, 2, 434, 0, "Connection", #TCX_BK_GRADIENT|#TCX_TRANSPARENT|#TCX_VCENTRE)
  
  window = Frame3DGadget(#Frame3D_7, 13, 44, 410, 90, "IRC Details")
  SetWindowLongPtr_(window, #GWL_EXSTYLE, GetWindowLongPtr_(window, #GWL_EXSTYLE)|#WS_EX_TRANSPARENT)
  TextGadget(#Text_10, 30, 68, 60, 20, "Nick Name")
  hStringGadget = StringGadget(#String_9, 90, 68, 120, 20, "")

  SetGadgetColor(#String_9,#PB_Gadget_BackColor ,RGB(230, 54, 146))        ;<<<<<<<<<<<<

  SendMessage_(hStringGadget, #EM_SETLIMITTEXT, 9, 0)
.....

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Sat Feb 11, 2012 11:35 am
by Poshu
Well, Progui is not compatible with pb command set, you need to check the documentation and SetTextControlExColour(ID.i, TextColour.l, BackColour.l)

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Sat Feb 11, 2012 2:45 pm
by PrincieD
ruslanx wrote:Hi PrincieD, how can I change background color of a string gadget ...SetGadgetColor not working ... ??~!

from 'PreferencesExample.pb' :

Code: Select all

  ;/ connection pannel
  window = AddPanelExImagePage(0, image(5)\normal, 0, 0, 0, 0, #PNLX_CENTRE|#PNLX_VCENTRE)
  TextControlEx(window, #TextControl_1, 2, 2, 434, 0, "Connection", #TCX_BK_GRADIENT|#TCX_TRANSPARENT|#TCX_VCENTRE)
  
  window = Frame3DGadget(#Frame3D_7, 13, 44, 410, 90, "IRC Details")
  SetWindowLongPtr_(window, #GWL_EXSTYLE, GetWindowLongPtr_(window, #GWL_EXSTYLE)|#WS_EX_TRANSPARENT)
  TextGadget(#Text_10, 30, 68, 60, 20, "Nick Name")
  hStringGadget = StringGadget(#String_9, 90, 68, 120, 20, "")

  SetGadgetColor(#String_9,#PB_Gadget_BackColor ,RGB(230, 54, 146))        ;<<<<<<<<<<<<

  SendMessage_(hStringGadget, #EM_SETLIMITTEXT, 9, 0)
.....
Hi ruslanx,

This is a bit of an oversight/bug in PureBasic. The StringGadget isn't actually coloured by the Windows API it's coloured by owner-draw code that PureBasic handles, unfortunately PureBasic doesn't keep track of the StringGadget if it's inside a none PB window using UseGadgetList and hence the owner-draw code is not executed. The owner-draw code that colours the string gadget is apparently in the main window callback instead of being in the actual string gadget's callback :?

I can't think of a work around at the moment but there might be one. I'll be adding a skinned edit gadget very soon to ProGUI anyway so this won't be an issue in the future.

Chris.

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Tue Feb 14, 2012 8:32 am
by blueznl
> unfortunately PureBasic doesn't keep track of the StringGadget if it's inside a none PB window using UseGadgetList

'inside a none' may cause some confusion...

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Wed Feb 15, 2012 4:01 pm
by PrincieD
blueznl wrote:> unfortunately PureBasic doesn't keep track of the StringGadget if it's inside a none PB window using UseGadgetList

'inside a none' may cause some confusion...
Sorry I meant a window created using the Windows API not PB's OpenWindow()

Chris.

Re: ProGUI V1.31 User Interface Library (Bug Fix Release)

Posted: Thu Feb 16, 2012 4:51 pm
by PrincieD
Hey guys, just realised that ProGUI is using about 400 meg (64bit version) of virtual memory in ProcessExplorer :shock: :shock: I've isolated it down to the skin subsystem using nested maps in the structures so beware of this if you have a map of a structure with another map of a structure inside that one and so on. I'll be re-factoring the internals to use just linked lists for the skin subsystem over the next few days but don't worry the external API will remain unchanged. What a bummer lol *sigh

Chris.

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Thu Feb 16, 2012 11:00 pm
by PrincieD
Fixed! :D

See top of thread!

Chris.

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Fri Feb 17, 2012 2:13 am
by electrochrisso
Great stuff.
Keep up the good work. :)

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Fri Feb 17, 2012 3:35 pm
by PrincieD
electrochrisso wrote:Great stuff.
Keep up the good work. :)
Thanks mate! :)

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Fri Feb 17, 2012 10:26 pm
by Starwolf20
Hi PrincieD
I'am trying the Imagebutton but i can't manage to make it work like i want to :
It seems that ExbuttonImageEx() and ToolBarImageButtonEx() acts differently when you pass the mouse on them.
With ImageToolBarEx(),the 'normal' image and the 'hot' image mixes.
Bye

Code: Select all

; Remember to enable XP Skin Support!
; Demonstrates how ProGUI components can easily be used
; to create novel, attractive and sophisticated user interfaces.

CompilerIf Defined(StartProGUI, #PB_Function) = #False
  IncludeFile "ProGUI_PB.pb"
CompilerEndIf
StartProGUI("", 0, 0, 0, 0, 0, 0, 0)

Global w_xpos
Global w_ypos
Global w_width
Global w_height
w_width = 800
w_height = 600

;- Window Constants
Enumeration
  #Window_0
EndEnumeration

Enumeration
  #TOOLBAR_0
EndEnumeration

Enumeration
  #TBUTTON_12
  #TBUTTON_16
  #TBUTTON_16b
EndEnumeration

; set up structure for easy access to images
Structure images
  normal.l
  hot.l
  disabled.l
EndStructure
Global Dim image.images(60)

;- Load in some images
ImgPath("Icons\DCCManager") ; set the default path for LoadImg

; preferences button
image(12)\normal = LoadImg("wrench.ico", 0, 0, 0)
image(12)\hot = LoadImg("wrench_h.ico", 0, 0, 0)
image(12)\disabled = LoadImg("wrench_p.ico", 0, 0, 0)

; about button
image(29)\normal = LoadImg("DCC2_32x32.ico", 0, 0, 0)
image(29)\hot = LoadImg("DCC2_32x32_h.ico", 0, 0, 0)
image(29)\disabled = LoadImg("DCC2_32x32_p.ico", 0, 0, 0)


Procedure Open_Window_0()
   
  OpenWindow(#Window_0, 0, 0, w_width, w_height, "DCC Manager V1.8 User Interface Example", #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget); | #PB_Window_Invisible)
  WindowBounds(#Window_0, 400, 200, #PB_Ignore, #PB_Ignore)
  SetWindowColor(#Window_0, $996633)

  If IsWindow(#Window_0)
    toolbar = CreateToolBarEx(#TOOLBAR_0, WindowID(#Window_0), 53, 39, #UISTYLE_IMAGE)
    
    ToolBarImageButtonEx(#TBUTTON_12, "", image(12)\normal, image(29)\hot, image(29)\disabled, #BTNS_AUTOSIZE)
    ToolBarImageButtonEx(#TBUTTON_16, "", image(29)\normal, image(29)\hot, image(29)\disabled, #BTNS_AUTOSIZE)
  EndIf
  ImageButtonEx(WindowID(#Window_0),    #TBUTTON_16b, 100, 100, 0, 0,  image(12)\normal, image(29)\hot, image(29)\hot, image(12)\disabled)
EndProcedure


Open_Window_0()
;HideWindow(#Window_0, #False)

Repeat
  Event = WaitWindowEvent()

   If Event = #PB_Event_Gadget
    gadget = EventGadget()
    Debug "gadget=" + Str(gadget)
  EndIf
  
Until Event = #WM_CLOSE
CloseWindow(#Window_0)
End

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Fri Feb 17, 2012 10:57 pm
by PrincieD
Starwolf20 wrote:Hi PrincieD
I'am trying the Imagebutton but i can't manage to make it work like i want to :
It seems that ExbuttonImageEx() and ToolBarImageButtonEx() acts differently when you pass the mouse on them.
With ImageToolBarEx(),the 'normal' image and the 'hot' image mixes.
Hi Starwolf20,

The ImageButtonEx doesn't support "cross fade" animation between the states yet, this will come later once I've refined the animation sub-system a bit.
If you want this effect then you can just use a "one button" ToolbarEx with the #UISTYLE_IMAGE flag set like you have in your posted code.

Chris.

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Sat Feb 18, 2012 9:06 pm
by Starwolf20
PrincieD wrote:If you want this effect then you can just use a "one button" ToolbarEx
Yes, thanks

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Fri Mar 02, 2012 8:11 pm
by Kuron
PrincieD: Two questions for you:

1. Have you had a chance to look at the slow start up issue?
2. If so, have you had a chance to update the compiled examples?

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Mon Mar 05, 2012 7:12 pm
by PrincieD
Kuron wrote:PrincieD: Two questions for you:

1. Have you had a chance to look at the slow start up issue?
2. If so, have you had a chance to update the compiled examples?
Hey Kuron,

Yep it's been fixed since V1.31, the DLL version should load up almost instantaneously now :)

Chris.

Re: ProGUI V1.32 User Interface Library (Huge Memory Usage F

Posted: Mon Mar 05, 2012 7:14 pm
by PrincieD
Hey guys!

Here's a new ButtonEx example demonstrating basic skin modification and the fancy effects you can achieve by dropping them into a PanelEx page :)

Just save the following code into your ProGUI Examples folder:

Code: Select all

; Remember to enable XP Skin Support!
; Demonstrates how to use the ButtonEx controls

CompilerIf Defined(StartProGUI, #PB_Function) = #False
  IncludeFile "ProGUI_PB.pb"
CompilerEndIf
StartProGUI("", 0, 0, 0, 0, 0, 0, 0)


;- Window Constants
Enumeration
  #Window_0
EndEnumeration

;- Menu/Button Command Constants
Enumeration
  #Command_Button1
  #Command_Button2
  #Command_Button3
EndEnumeration

; set up structure for easy access to icon images
Structure images
  normal.i
  hot.i
  pressed.i
  disabled.i
EndStructure
Global Dim image.images(3)

; load in some example icons
image(0)\normal = LoadImg("icons\shell32_235.ico", 16, 16, 0)
image(0)\hot = ImgBlend(image(0)\normal, 255, 30, 0, 0, 0, 0)
image(0)\pressed = ImgBlend(image(0)\normal, 255, 0, -30, 0, 0, 0)
image(1)\normal = ImgBlend(LoadImg("icons\shell32_4.ico", 96, 96, 0), 100, 0, 0, 0, 0, #ImgBlend_DestroyOriginal)
image(2)\normal = LoadImg("icons\dccmanager\downloadpanel_border.png", 0, 0, 0)

;- process ProGUI Windows event messages here
; events can also be simply captured using WaitWindowEvent() too in the main event loop, but for ease of porting the examples to other languages the callback method is used.
; #PB_Event_Menu and EventMenu() can be used to get the selected menu item when using the WaitWindowEvent() method.
Procedure ProGUI_EventCallback(hwnd, message, wParam, lParam)
  
  Select message
      
    ; handle selection of menu items and buttons
    Case #WM_COMMAND
      
      If HWord(wParam) = 0 ; is an ID
          
        MenuID = LWord(wParam)
      
        Debug MenuID
        
      EndIf
        
    ; resize panelex and textcontrolex when main window resized
    Case #WM_SIZE
      
      MoveWindow_(PanelExID(0, -1), 5, 5, WindowWidth(#Window_0)-10, WindowHeight(#Window_0)-10, #True)
      
  EndSelect
  
  ProcedureReturn #PB_ProcessPureBasicEvents
  
EndProcedure

; creates a window
Procedure Open_Window_0()
  
  OpenWindow(#Window_0, 50, 50, 700, 500, "Button Example: Resize the main window!", #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_Invisible)
  
  ; create PanelEx as main window content
  CreatePanelEx(0, WindowID(#Window_0), 215, 5, 480, 490, 0)
  page = AddPanelExImagePage(2, image(1)\normal, 0, 0, 0, 0, #PNLX_CENTRE|#PNLX_VCENTRE)
  SetPanelExPageBorder(0, 0, image(2)\normal, -1, 0, 0)
  SetPanelExPageScrolling(0, 0, #PNLX_AUTOSCROLL, #True)
  
  ButtonEx(page, #Command_Button1, 100, 100, 200, 100, "A Great Big Button!", 0, 0, 0, 0, 0)
  ButtonEx(page, #Command_Button2, 100, 200, 160, 32, "Button and Icon", image(0)\normal, image(0)\hot, image(0)\pressed, 0, 0)
  
  ; copy system default skin of ButtonEx
  skin = GetButtonExSkin(#Command_Button1)
  newSkin = CopySkin(skin)
  ; make position of icon for normal state left aligned
  SetSkinProperty(newSkin, "buttonex", "normal", "image position", "x: 0; y: centre")
  ; add a background image for hot state
  SetSkinProperty(newSkin, "buttonex", "hot", "background image", "icons\newlogo2_256x256.png")
  ; make text red for hot state
  SetSkinProperty(newSkin, "buttonex", "hot", "text", "colour: red")
  ButtonEx(page, #Command_Button3, 400, 200, 200, 64, "Button and Modified Skin", image(0)\normal, image(0)\hot, image(0)\pressed, 0, newSkin)
  
  
  ; attach our events callback for processing Windows ProGUI messages
  SetWindowCallback(@ProGUI_EventCallback())
  
EndProcedure


Open_Window_0() ; create window
HideWindow(0, 0)  ; show our newly created window

; enter main event loop
Repeat
  
  Event = WaitWindowEvent()
  
Until Event = #WM_CLOSE

End
Cheers!

Chris.