![]() |
Anzeige:
|
|
|||||||
| XProfan Alles rund um die Programmiersprache XProfan. |
|
![]() |
|
|
LinkBack | Themen-Optionen | Ansicht |
|
|
#1 (Direktlink) |
|
Erfolgreich angemeldet
![]() Registriert seit: 15.04.2010
Beiträge: 19
|
Hallo,
kurzes Problem: möchte u.a. eine Listview von der Größe her dem Hauptfenster mit SetWindowPos anpassen; das Fenster kann ich von der Breite her verändern. Da ich das Flackern der vorhandenen Elemente bei der Größenänderung verhindern will, setzte ich den Style: "SetStyle %hwnd, 1, GetStyle(%hwnd, 1) | $02000000" ein - die Listview wird zerstört, die Prozessorauslastung steigt auf 100% - kann mir jemand einen Tipp geben - besten Dank! Gruß Jürgen. |
|
|
|
|
|
|
#2 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Hallo Jürgen,
setzt du den Style beim Listview oder beim Fenster? Welcher Ex-Style soll das denn sein? Hast du einen kurzen Democode?
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
#3 (Direktlink) |
|
Erfolgreich angemeldet
![]() Registriert seit: 15.04.2010
Beiträge: 19
|
Code:
$H Messages.ph
$H Windows.ph
SubClassProc
If SubClassMessage(%hWnd, ~wm_sizing)
SetStyle %hwnd, 1, GetStyle(%hwnd, 1) | $02000000
Resize
Set("WinProc", 0)
ElseIf SubClassMessage(bt&, ~wm_rbuttondown)
SetText bt&, "Autsch!"
Set("WinProc", 0)
ElseIf SubClassMessage(bt&, ~wm_rbuttonup)
SetText bt&, "Test1"
SetMenuItem 3000
Set("WinProc", 0)
ElseIf SubClassMessage(st&, ~wm_mousemove)
SetMenuItem 3001
Set("WinProc", 0)
ElseIf SubClassMessage(%hwnd, ~wm_close)
SetMenuItem 3999
Set("WinProc", 0)
EndIf
EndProc
Proc Resize
SetWindowPos bt& = 0, 50 - Width(%HWnd)/2, Height(%HWnd) - 75
SetWindowPos bt2& = Width(%HWnd)/2, 50 - Width(%HWnd)/2, Height(%HWnd) - 75
SetWindowPos st& = 0, 0 - 0,0; 0
SetWindowPos tb& = 0, 0 - 0,0; 0
EndProc
declare bt&, bt2&, st&, tb&
declare ende%
cls
st& = create("StatusWindow", %HWnd, "Statuszeile")
tb& = create("Toolbar", %HWnd,0,15,1,1000,1)
bt& = create("Button", %HWnd, "Test1", 0, 50, Width(%HWnd)/2, Height(%HWnd) - 75)
bt2& = create("Button", %HWnd, "Test2", Width(%HWnd)/2, 50, Width(%HWnd)/2, Height(%HWnd) - 75)
SubClass %HWnd, 1 'SubClassing des Hauptfensters einschalten
SubClass bt&, 1 'SubClassing des 1. Buttons einschalten
SubClass st&, 1 'SubClassing der Statuszeile einschalten
whilenot ende%
waitinput
If %Key = 4
Resize
SetStyle %hwnd, 1, GetStyle(%hwnd, 1) - $02000000
ElseIf MenuItem(3000)
MessageBox("Rechtsklick auf Button 1!","Test",0)
ElseIf MenuItem(3001)
MessageBox("Mausbewegung über Statuszeile!","Test",0)
ElseIf MenuItem(3002)
MessageBox("wm_activate","Test",0)
ElseIf MenuItem(3003)
MessageBox("wm_syscommand",str$(&sWParam),0)
ElseIf MenuItem(3999)
Case Messagebox("Wollen Sie das Programm wirklich verlassen?","Frage",36) = 6 : Ende% = 1
EndIf
endwhile
' Subclassing wieder ausschalten
SubClass %HWnd, 0
SubClass bt&, 0
SubClass st&, 0
end
In meinem eigentlichen Programm habe ich im Hauptfenster ein Treeview, 2 Multiedits und die Listview, die ich der Fenstergröße anpassen will. Da das Hauptfenster beim vergrößern flackert, wollte ich den Style ausprobieren. Das flackern ist weg, die Listview reagiert aber nicht mehr. Will den Setstyle beim Resize verwenden. Hoffe du kannst mir einen Tipp geben. Gruß Jürgen |
|
|
|
|
|
#4 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Ich denke schon. In deinem Code wird aber gar kein Listview.dll-Control verwendet.
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
#5 (Direktlink) |
|
Stammuser
![]() Registriert seit: 04.04.2009
Ort: Lübeck
Beiträge: 264
|
Vielleicht hilft der Teilcode aus Daten per Drag+Drop übernehmen und csv-Datei erstellen
Code:
Def GetSysColor(1) !"USER32","GetSysColor"
$I Listview_Funktionen.inc
var lvdll&=usedll("Listview.dll")
window 0,0 - 630,240
Cls GetSysColor(15)
var parent&=%hwnd
var lb&=CreateListView(%hwnd,%hinstance,0,rgb(255,255,255),-1,$33)
InsertColumn lb&,"1. Spalte",90,0
InsertColumn lb&,"2. Spalte",90,0
ShowListView(lb&,8,40,0,0)
declare _dlgw&,_dlgh&,_odlgw&,_odlgh&
declare x!,y!,x%,y%
thread.do
While 1
case %key=2:break
WaitInput
thread.do
EndWhile
freedll lvdll&
$I Listview_Dispose.inc
DeleteObject font&
DeleteObject ico11&
DeleteObject bmp&,bmp1&,bmp2&,bmp3&,bmp4&,bmp5&,bmp6&
End
proc thread.do
_dlgw&=width(parent&)
_dlgh&=height(parent&)
if ( ( _odlgw&<>_dlgw& ) or ( _odlgh&<>_dlgh& ) )
case _dlgw&>0: y!= _odlgw& / _dlgw&
_odlgw&=_dlgw&
_odlgh&=_dlgh&
_redrw y!
endif
x%=416
endproc
proc _redrw
Parameters x!
ShowListView(lb&,10,4,(width(%hWnd)-20),(height(%hWnd)-40))
WhileLoop 0, (GetColumns(Lb&)-1)
casenot x! = 0 : @SetColumnWidth(Lb&,&loop,(GetColumnWidth(lb&,&loop) / x! ),-1)
Wend
endproc
Gruß Thomas Geändert von THFR (17.03.2011 um 12:37 Uhr) |
|
|
|
|
|
|
#6 (Direktlink) |
|
Erfolgreich angemeldet
![]() Registriert seit: 15.04.2010
Beiträge: 19
|
Code:
Proc Resize
If Width(%hWnd)<800
SetWindowPos Listview&=256,3-(Width(%hWnd)-260),(Height(%hWnd)/1.70)
SetWindowPos TreeView_MWnd&=53,3-200,(Height(%hWnd)/1.70)
ValueMaxY%=Height(Listview&)+45
SetWindowPos GroupBox1_MWnd&=53,(Height(Listview&)+30)-(Width(%hWnd)/2.25),(Height(%hWnd)-ValueMaxY%+10)
SetWindowPos GroupBox2_MWnd&=(Width(GroupBox1_MWnd&)+57),(Height(Listview&)+30)-(Width(%hWnd)-51)-(Width(GroupBox1_MWnd&)+10),(Height(%hWnd)-ValueMaxY%+10)
SetWindowPos MultiEdit1_MWnd&=60,(Height(Listview&)+80)-(Width(GroupBox1_MWnd&)-15),(Height(GroupBox1_MWnd&)-60)
SetWindowPos MultiEdit2_MWnd&=(Width(GroupBox1_MWnd&)+65),(Height(Listview&)+80)-(Width(%hWnd)-45)-(Width(GroupBox1_MWnd&)+30),(Height(GroupBox1_MWnd&)-60)
SetWindowPos PicButton1_MWnd&=,60,(Height(Listview&)+50)-20,20
SetWindowPos PicButton2_MWnd&=,85,(Height(Listview&)+50)-20,20
SetWindowPos PicButton3_MWnd&=,110,(Height(Listview&)+50)-20,20
SetWindowPos PicButton4_MWnd&=,(Width(GroupBox1_MWnd&)+65),(Height(Listview&)+50)-20,20
SetWindowPos PicButton5_MWnd&=,(Width(GroupBox1_MWnd&)+90),(Height(Listview&)+50)-20,20
SetWindowPos PicButton6_MWnd&=,(Width(GroupBox1_MWnd&)+115),(Height(Listview&)+50)-20,20
EndIf ' If Width(%hWnd)<800
If Width(%hWnd)>800
SetWindowPos Listview&=256,3-(Width(%hWnd)-260),(Height(%hWnd)/1.70)
SetWindowPos TreeView_MWnd&=53,3-200,(Height(%hWnd)/1.70)
ValueMaxY%=Height(Listview&)+45
SetWindowPos GroupBox1_MWnd&=53,(Height(Listview&)+30)-(Width(%hWnd)/2.25),(Height(%hWnd)-ValueMaxY%+10)
SetWindowPos GroupBox2_MWnd&=(Width(GroupBox1_MWnd&)+57),(Height(Listview&)+30)-(Width(%hWnd)-51)-(Width(GroupBox1_MWnd&)+10),(Height(%hWnd)-ValueMaxY%+10)
SetWindowPos MultiEdit1_MWnd&=60,(Height(Listview&)+80)-(Width(GroupBox1_MWnd&)-15),(Height(GroupBox1_MWnd&)-60)
SetWindowPos MultiEdit2_MWnd&=(Width(GroupBox1_MWnd&)+65),(Height(Listview&)+80)-(Width(%hWnd)-45)-(Width(GroupBox1_MWnd&)+30),(Height(GroupBox1_MWnd&)-60)
SetWindowPos PicButton1_MWnd&=,60,(Height(Listview&)+50)-20,20
SetWindowPos PicButton2_MWnd&=,85,(Height(Listview&)+50)-20,20
SetWindowPos PicButton3_MWnd&=,110,(Height(Listview&)+50)-20,20
SetWindowPos PicButton4_MWnd&=,(Width(GroupBox1_MWnd&)+65),(Height(Listview&)+50)-20,20
SetWindowPos PicButton5_MWnd&=,(Width(GroupBox1_MWnd&)+90),(Height(Listview&)+50)-20,20
SetWindowPos PicButton6_MWnd&=,(Width(GroupBox1_MWnd&)+115),(Height(Listview&)+50)-20,20
EndIf ' If Width(%hWnd)>800
EndProc
SubClassProc
If SubClassMessage(%hWnd, ~wm_sizing)
SetStyle %hwnd, 1, GetStyle(%hwnd, 1) | $02000000
Resize
Set("WinProc", 0)
EndIf
EndProc
Gruß Jürgen Geändert von Jürgen Baier (18.03.2011 um 06:34 Uhr) Grund: Nicht richtig beschrieben |
|
|
|
![]() |
|
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Listview.dll + IColumn | H.Brill | Dlls, Includes, Units & Prozeduren | 6 | 05.03.2011 13:41 |
| Listview ohne DLL | Gerhard Putschalka | XProfan | 7 | 05.08.2010 10:34 |
| Listview scrollt | THFR | Dlls, Includes, Units & Prozeduren | 0 | 22.05.2010 01:18 |
| listview | Peter C. | Spezielles | 6 | 29.03.2009 00:41 |
| Listview | Peter C. | Helfer & Tools | 3 | 28.03.2009 09:30 |