[Done] Stringgadget bug

Post bugreports for the Windows version here
drgolf
Enthusiast
Enthusiast
Posts: 111
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

[Done] Stringgadget bug

Post by drgolf »

Hello again,

With PB 6.30 B1, this code no longer work :

Code: Select all

If OpenWindow(0, 0, 0, 322, 205, "StringGadget BUG !", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    StringGadget(0, 10, 10, 200, 150, "aaaaaaa ",#ES_MULTILINE|#WS_BORDER|#WS_VSCROLL|#ES_AUTOVSCROLL|#PB_String_ReadOnly|#ES_WANTRETURN|#ESB_DISABLE_BOTH)
   
   SetGadgetText(0,"absvdhfdhfh")
  
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf
User avatar
STARGÅTE
Addict
Addict
Posts: 2235
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Stringgadget bug

Post by STARGÅTE »

What are all these Constants?
Only PB constants are officially supported!
https://www.purebasic.com/documentation ... adget.html

For multi line output, you can try to use the EditorGadget()
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Fred
Administrator
Administrator
Posts: 18243
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Stringgadget bug

Post by Fred »

The right way to do that is to use SetWindowLongPtr_() with the style flag
drgolf
Enthusiast
Enthusiast
Posts: 111
Joined: Tue Mar 03, 2009 3:40 pm
Location: france

Re: Stringgadget bug

Post by drgolf »

Hello Fred,

The #es_multiline style dont work with Setwindowlongptr_().

See windows api doc here : https://learn.microsoft.com/fr-fr/windo ... rol-styles

The stringgadget multiline is usefull because of contextmenu with clipboard functions.

I need to create the control and this is not easy (for me, simple and old coder).

Code: Select all

hInstance = GetModuleHandle_(0) 
   HwndEditText  = CreateWindowEx_(#WS_EX_STATICEDGE,"EDIT","",#WS_VISIBLE | #WS_CHILDWINDOW |#ES_MULTILINE|#WS_BORDER|#WS_VSCROLL|#ES_AUTOVSCROLL|#PB_String_ReadOnly|#ES_WANTRETURN|#ESB_DISABLE_BOTH, 10,10,280,120,WindowID(0),200,hInstance,0)
   SendMessage_(HwndEditText,#EM_REPLACESEL,0,"Hello"+#CRLF$+"aaaaaa")

Again, PB update break working apps...
Fred
Administrator
Administrator
Posts: 18243
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Stringgadget bug

Post by Fred »

May be if you used the commands as documented, it wouldn't break ? Just an idea.
User avatar
Kiffi
Addict
Addict
Posts: 1503
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Stringgadget bug

Post by Kiffi »

Fred wrote: Wed Sep 03, 2025 3:12 pm May be if you used the commands as documented, it wouldn't break ? Just an idea.
:mrgreen:
Hygge
Fred
Administrator
Administrator
Posts: 18243
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Stringgadget bug

Post by Fred »

I will revert the change as it can't be modified after creation with SetWindowLongPtr()
Fred
Administrator
Administrator
Posts: 18243
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] Stringgadget bug

Post by Fred »

Fixed.
Post Reply