ListViewGadget without any border

Windows specific forum
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

ListViewGadget without any border

Post by Hroudtwolf »

Hello, Bon Jour, Hallo, Bonjorno, Buenos Dias,


Do anyone knows n how to create a Listbox without any borders ?
(I don't want to use the containergadget-trick)
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Here's one for Windows only...

Code: Select all

If OpenWindow(0,0,0,270,140,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ListViewGadget") And CreateGadgetList(WindowID(0))
  ListViewGadget(0,10,10,250,120)
  SetWindowLong_(GadgetID(0), #GWL_EXSTYLE, GetWindowLong_(GadgetID(0), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE))
  For a=0 To 5
    AddGadgetItem (0,-1,"Item "+Str(a)+" of the Listview")
  Next
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hey thank you Wizard...äh Sparkie.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

You're very welcome Hroudtwolf :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

It works with parentwindows perfectly. But with childwindows isn't any result.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Not sure I understand. Can you post the non-working code :?:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

This idea is not so good ! There are more than 1000 lines in my code.


But, I can post a part of it:

Code: Select all

Procedure NeuesFenster()
Style.l = #ws_popup|#WS_CHILD|#WS_CLIPCHILDREN|#WS_CAPTION|#WS_SIZEBOX|#WS_SYSMENU|#WS_MAXIMIZEBOX|#WS_MINIMIZEBOX
hand.l=OpenWindow (#pb_any,10+((CountList(Fenster())+1)*20),30+((CountList(Fenster())+1)*10),600,500,Style.l,"Unbekannt.pb",WindowID(hID.l))
SetParent_(WindowID(hand.l),WindowID(hID.l)) 
If CreateGadgetList (WindowID(hand.l))
UseWindow(hand.l)
Editor.l=EditorGadget (#pb_any,50,0,WindowWidth()-50,WindowHeight()-23)
nummern.l=ListViewGadget(#pb_any,0,0,50,WindowHeight()-23)
SetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE, GetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE))
statustext.l=TextGadget (#pb_any,0,WindowHeight()-22,WindowWidth(),20,"", #PB_Text_Border )
SendMessage_(GadgetID(Editor.l),#EM_SETBKGNDCOLOR,#NULL,$E5FFFF)
SendMessage_(GadgetID(Editor.l), #EM_EXLIMITTEXT, 0, 122880)
style = GetWindowLong_(GadgetID(Editor.l), #GWL_EXSTYLE)
newstyle = style &(~#WS_EX_CLIENTEDGE)
SetWindowLong_(GadgetID(Editor.l), #GWL_EXSTYLE, newstyle)
SetWindowPos_(GadgetID(Editor.l), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED) 
endIf 
UseWindow(hID.l)
AddElement (Fenster())
Fenster()\handle=hand.l
Fenster()\title="Unbekannt.pb"
Fenster()\editor=Editor.l
Fenster()\status=statustext.l
Fenster()\nummern=nummern.l
EndProcedure 
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I'm on my way out the door, but I'll take a look later this evening. :wink:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Ok. Thanks. :)
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Sparkie wrote:Here's one for Windows only...
It doesn't work in Win2000.
The output is "standard"
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

I solved the problem.

Now it works.

Code: Select all

nummern.l=ListViewGadget(#pb_any, 0,20, 50, WindowHeight ()-43)
style = GetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE)
newstyle = style &(~#WS_EX_CLIENTEDGE)
SetWindowLong_(GadgetID(nummern.l), #GWL_EXSTYLE, newstyle)
SetWindowPos_(GadgetID(nummern.l), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

@ Hroudtwolf - Glad to see you figured it out. :)

@ Blade - Maybe that's because I forgot one line of code :oops:(SetWindowPos() with the #SWP_FRAMECHANGED flag). See if this works on 2000...

Code: Select all

If OpenWindow(0,0,0,270,140,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"ListViewGadget") And CreateGadgetList(WindowID(0)) 
  ListViewGadget(0,10,10,250,120) 
  SetWindowLong_(GadgetID(0), #GWL_EXSTYLE, GetWindowLong_(GadgetID(0), #GWL_EXSTYLE) &(~#WS_EX_CLIENTEDGE)) 
  SetWindowPos_(GadgetID(0), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOZORDER | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
  For a=0 To 5 
    AddGadgetItem (0,-1,"Item "+Str(a)+" of the Listview") 
  Next 
  Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow 
EndIf 
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Now works :)
Post Reply