Set "#ES_LOWERCASE" for StringGadget in Runtime

Just starting out? Need help? Post your questions and find answers here.
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Set "#ES_LOWERCASE" for StringGadget in Runtime

Post by +18 »

how can i set #ES_LOWERCASE flag for StringGadget in Runtime?
I use below code , made error only

Code: Select all

OpenWindow(0,0,0,100,100,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
 StringGadget(0,25,37,70,25,"")
 SendMessage_(GadgetID(0), #ES_LOWERCASE, 0, 0)
 SetActiveGadget(0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Post by +18 »

And too, possible it set a group of flags in runtime.

Code: Select all

GroupFlags = #ES_MULTILINE|#ES_AUTOVSCROLL|#WS_VSCROLL|#WS_HSCROLL|#ESB_DISABLE_LEFT|#ESB_DISABLE_RIGHT
please a sample if it's possible
Thankful
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Code: Select all

OpenWindow(0,0,0,100,100,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) 
 StringGadget(0,25,37,70,25,"") 
 SetWindowLong_(GadgetID(0), #GWL_STYLE, GetWindowLong_(GadgetID(0), #GWL_STYLE)|#ES_LOWERCASE) 
 SetActiveGadget(0) 
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Works on Vista - not sure about XP ?
I may look like a mule, but I'm not a complete ass.
+18
Enthusiast
Enthusiast
Posts: 228
Joined: Fri Oct 24, 2008 2:07 pm

Post by +18 »

Thanks srod :D
work on XP excellent
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Hello SROD :D

Cool this tips 8)

But it create a question in my head :roll:
Is it possible to cancel this function in runtime ???
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Kwaï chang caïne wrote:Is it possible to cancel this function in runtime ???
Add style : Bitwise OR #Style

Code: Select all

 SetWindowLong_(GadgetID(x), #GWL_STYLE, GetWindowLong_(GadgetID(x), #GWL_STYLE) | #MyStyle)
Remove style : Bitwise AND NOT (#Style)

Code: Select all

 SetWindowLong_(GadgetID(x), #GWL_STYLE, GetWindowLong_(GadgetID(x), #GWL_STYLE) & ~#MyStyle)
http://www.purebasic.com/documentation/ ... ables.html
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5709
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Yeeeaaaahhh again more cool :D
And the best miracle, it's that KCC have understand :D

Thanks too for your tips GNOZAL
My life for 10% of your knowledge 8)

I wish you a good good day
ImageThe happiness is a road...
Not a destination

PureBasic French Forum
User avatar
Alireza
Enthusiast
Enthusiast
Posts: 143
Joined: Sat Aug 16, 2008 2:02 pm
Location: Iran

Post by Alireza »

oh, i need same code for a SetSortedCombobox after executed my project:

Work:

Code: Select all

; http://www.purebasic.com
; Author: Andre Beer (updated for PB4.00 by blbltheworm)
; Date: 27. May 2003
; OS: Windows
; Demo: No

If OpenWindow(0,100,130,220,100,"ComboBox Sorted",#PB_Window_SystemMenu)
  If WindowID(0)
    cb.l = ComboBoxGadget(1,10,10,200,25,#CBS_SORT) 
    SendMessage_(cb,#CB_ADDSTRING,0,"3")    ; the items will be added in random order
    SendMessage_(cb,#CB_ADDSTRING,0,"4") 
    SendMessage_(cb,#CB_ADDSTRING,0,"1")    ; .... but they will be displayed in sorted order
    SendMessage_(cb,#CB_ADDSTRING,0,"2") 
  EndIf
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf

; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableXP
Don't work:

Code: Select all

; http://www.purebasic.com
; Author: Andre Beer (updated for PB4.00 by blbltheworm)
; Date: 27. May 2003
; OS: Windows
; Demo: No

If OpenWindow(0,100,130,220,100,"ComboBox Sorted",#PB_Window_SystemMenu)
  If WindowID(0)
    cb.l = ComboBoxGadget(1,10,10,200,25) 
    ;------------------
     SetWindowLong_(GadgetID(1), #GWL_STYLE, GetWindowLong_(GadgetID(1), #GWL_STYLE) | #CBS_SORT);<<<<<<<<<<<<<<<<<<<<<<
    ;------------------
    SendMessage_(cb,#CB_ADDSTRING,0,"3")    ; the items will be added in random order
    SendMessage_(cb,#CB_ADDSTRING,0,"4") 
    SendMessage_(cb,#CB_ADDSTRING,0,"1")    ; .... but they will be displayed in sorted order
    SendMessage_(cb,#CB_ADDSTRING,0,"2") 
  EndIf
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf

; IDE Options = PureBasic v4.00 (Windows - x86)
; Folding = -
; EnableXP
Masters ,Help
Merci
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Many styles cannot be set (or unset) after the control is created. I would guess that this is one such style.
I may look like a mule, but I'm not a complete ass.
User avatar
Alireza
Enthusiast
Enthusiast
Posts: 143
Joined: Sat Aug 16, 2008 2:02 pm
Location: Iran

Post by Alireza »

Ok, then i think must be a lot of fortune in hand :D
Thanks srod
Post Reply