Page 21 of 35

Posted: Sun Nov 25, 2007 9:16 am
by GG
Links are OK for me.

Posted: Sun Nov 25, 2007 10:51 am
by PB
> Links are OK for me

Yep, they're working now. Before I was getting errors of some sort, which
I assume were 404's but can't be sure as it wasn't in English. Had an image
of some girl's face.

Posted: Sun Nov 25, 2007 2:35 pm
by PB
Is there any way to color a CheckBoxGadget's square with this? I couldn't
find anything in the Manual for it, and setting the BackColor for it only
changes the background of its text part.

Posted: Mon Nov 26, 2007 8:51 am
by gnozal
PB wrote:Is there any way to color a CheckBoxGadget's square with this?
No, sorry.

Posted: Mon Nov 26, 2007 9:49 am
by PB
For the future, perhaps?

Posted: Mon Nov 26, 2007 12:00 pm
by gnozal
PB wrote:For the future, perhaps?
Maybe :wink:

Posted: Mon Nov 26, 2007 12:03 pm
by gnozal
Update (all versions)

Changes :
- (new) menu functions : changed tab calculation. Tabbed menu items should now be correctly aligned in all cases.

EDIT : uploaded version 13.02

Posted: Mon Nov 26, 2007 2:37 pm
by gnozal
byo wrote:It's not working here:

Code: Select all

SetGadgetText(#txDicas, dica)
InvalidateRect_(WindowID(#wMain), rect, #True)
Unless there's something else to be done or I'm doing something wrong.

Thanks for the fast reply.
You could also draw on the window :

Code: Select all

...
      Select EventGadget() 
        Case 2 
          SetGadgetText(0, "this text was changed correctly!") 
          If StartDrawing(WindowOutput(0))
            Box(GadgetX(1), GadgetY(1), GadgetWidth(1), GadgetHeight(1), GetSysColor_(#COLOR_3DFACE))
            StopDrawing()
          EndIf
          SetGadgetText(1, "this text was not changed correctly!") 
      EndSelect 
...

Posted: Tue Nov 27, 2007 2:18 am
by byo
gnozal & srod.

You guys are cool. Maybe someday we can meet to share a dozen of beers or something. :lol:

BTW, gnozal, your example works fine except that I'm using an image as a background for a window:

Code: Select all

brush = CreatePatternBrush_(ImageID(imgBackground))
SetClassLong_(WindowID(#wMain), #GCL_HBRBACKGROUND, brush)
And I need to display this image behind the components when needed so I can't use the system's color not even draw by myself.

I noticed something strange: if you have a container and set the container to #PureColor_DontSetbackColor the background image will start from the window top and left and will not draw the part of the image behind the container, leaving the container's background a little misplaced.

I'll post some minimal code showing that. Thanks for being so friendly and helpful. Guys like you are hard to find on message boards.

Posted: Tue Nov 27, 2007 11:36 pm
by Rook Zimbabwe
Very small issue:

If I have a multiline button and I color it... it is NO LONGER multiline!!! :(

Is ther a workaround?

Posted: Wed Nov 28, 2007 10:41 am
by gnozal
Rook Zimbabwe wrote:Very small issue:

If I have a multiline button and I color it... it is NO LONGER multiline!!! :(

Is ther a workaround?
Works here ?

Code: Select all

Enumeration
  #Window_0
EndEnumeration
Enumeration
  #Button_0
EndEnumeration
Define.l Event, EventWindow, EventGadget, EventType, EventMenu
Procedure OpenWindow_Window_0()
  If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
    If CreateGadgetList(WindowID(#Window_0))
      ButtonGadget(#Button_0, 125, 85, 170, 45, "Line 1" + #CrLf$ + "Line 2", #PB_Button_MultiLine)
      PureCOLOR_SetButtonColor(#Button_0, $FF, #PureCOLOR_SystemColor)
    EndIf
  EndIf
EndProcedure

OpenWindow_Window_0()

Repeat
  Event = WaitWindowEvent()
  Select Event
    Case #PB_Event_Gadget
      EventGadget = EventGadget()
      EventType = EventType()
      If EventGadget = #Button_0
      EndIf
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
Forever

Posted: Wed Nov 28, 2007 10:44 am
by gnozal
Update (all versions)

Changes :
- Icon menus now also work with WinNT4 [tested Win9x/WinNT4/WinXP]
- Added MenuTabAlign parameter to PureCOLOR_SetMenuOptions() : tabbed menu text alignment (#DT_RIGHT, #DT_LEFT, #DT_CENTER) [default is #DT_RIGHT])

Posted: Wed Nov 28, 2007 10:33 pm
by Rook Zimbabwe
Well in your example I only say Line1 and not Line2

I have tried this with UNICODE and NOT UNICODE :D

Code: Select all


Enumeration 
  #Window_0 
EndEnumeration 
Enumeration 
  #Button_0 
EndEnumeration 
Define.l Event, EventWindow, EventGadget, EventType, EventMenu 
Procedure OpenWindow_Window_0() 
  If OpenWindow(#Window_0, 450, 200, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar) 
    If CreateGadgetList(WindowID(#Window_0)) 
      ButtonGadget(#Button_0, 125, 85, 170, 45, "Line 1 we only see 1 line of text on the button and we are sing UNICODE", #PB_Button_MultiLine) 
      ; PureCOLOR_SetButtonColor(#Button_0, $FF, #PureCOLOR_SystemColor) 
      PureCOLOR_SetButtonColor(#Button_0, RGB(255,255,255), RGB(180,0,0), RGB(255,127,0), RGB(255,255,0))

    EndIf 
  EndIf 
EndProcedure 

OpenWindow_Window_0() 

Repeat 
  Event = WaitWindowEvent() 
  Select Event 
    Case #PB_Event_Gadget 
      EventGadget = EventGadget() 
      EventType = EventType() 
      If EventGadget = #Button_0 
      EndIf 
    Case #PB_Event_CloseWindow 
      EventWindow = EventWindow() 
      If EventWindow = #Window_0 
        CloseWindow(#Window_0) 
        Break 
      EndIf 
  EndSelect 
ForEver

Image
HMMM? I don't know... now I did tell it to use different colors when clicked etc. :D

Compiler is set to produce UNICODE

When off the buttons have color but no text...

ALSO... when I turned on threadsafe I get a nasty popup window that says:
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: Fatal Error: 1 unresolved external(s.)
:?:

Posted: Thu Nov 29, 2007 8:47 am
by gnozal
Rook Zimbabwe wrote:Well in your example I only say Line1 and not Line2
You mean you see line 1 and not line 2 if you compile my code example ?
And if you increase the gadget height ?
Rook Zimbabwe wrote:ButtonGadget(#Button_0, 125, 85, 170, 45, "Line 1 we only see 1 line of text on the button and we are sing UNICODE", #PB_Button_MultiLine)
Anyway, #PB_Button_MultiLine currently only works if you use #CrLf$.
Rook Zimbabwe wrote:POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: Fatal Error: 1 unresolved external(s.)
Did you use the adapted subsystem ?

Posted: Fri Nov 30, 2007 4:40 am
by Rook Zimbabwe
#CrLf$

Crap! That will make it unusable in most instances... My program allows the user to change the text on the buttons. Auto line length is a must.
You mean you see line 1 and not line 2 if you compile my code example ?

Yes... I only see the text that says Line 1
And if you increase the gadget height ?
Still line 1... I have tried it both with the UNICODE off and ON and also both with the UNICODE LIB and Regular LIB. (4 ways tried it!)
Did you use the adapted subsystem ?
Umm.... I don't know... What is it?