![]() |
Anzeige:
|
|
|||||||
| XProfan Alles rund um die Programmiersprache XProfan. |
|
![]() |
|
|
LinkBack | Themen-Optionen | Ansicht |
|
|
#1 (Direktlink) |
|
Weiß worum´s geht
![]() Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
|
Trotz intensiver Suche ist es mir nicht gelungen ein
Beispiel zu finden, indem ein Static Control mit der Maus verschoben wird. Allgemein funktioniert die Releasecapture - Methode nur für Controls, die den Focus haben. Controls ohne Focus (Static, Groupbox etc) lassen sich so nicht verschieben. |
|
|
|
|
|
|
#2 (Direktlink) |
|
Weiß worum´s geht
![]() Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
|
Code:
DEF &WM_DESTROY $2
DEF &WM_NCHITTEST $84
Def &WM_NCLBUTTONDOWN $0A1
Def &HTCAPTION $02
Def ReleaseCapture(0) !"USER32","ReleaseCapture"
Def SetCapture(1) !"USER32","SetCapture"
$P+
SetErrorLevel 0
$I C:\PRFEllow\lib\Profalt.inc
$I C:\PRFELLOW\LIB\WFFORMS7.INC
$I C:\PRFELLOW\LIB\WFEVENTS.INC
$I C:\PRFELLOW\LIB\WFUPDOWN.INC
' *** GlobalStatements der Form
$H windows.ph
$H messages.ph
proc Moveobject
Parameters Ohwnd&
setcapture(Ohwnd&)
while 1
ReleaseCapture()
SendMessage (Ohwnd&,~WM_NCLButtonDown,&HTCAPTION,0)
Break
wend
endproc
Declare appexit%
SetTrueColor 1
WindowStyle $003F
WindowTitle "Spinedit anklicken und verschieben "
Window Add(%maxX,5),114 - 771,611
Cls GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
SetFormIcon "",0
Var editspin1&=CreateEdit(%hwnd,"",110,330,121,22)
var SpinEdit1&=CreateSpinEdit($54000026,0,0,0,0,%hwnd,2004,%hinstance,editspin1&,100,0,10)
var BuddySpinEdit1&=UDM_GetBuddy(SpinEdit1&)
Var spin2&=Create("SpinEdit",%HWnd,"0;-100;100",110,380,121,22)
SetWindowPos %hwnd = 207,114 - 771,611;0
WhileNot appexit%
WaitInput
WMNotifyHandler
If Equ(%key,2)
Let appexit%=1
ElseIf Getfocus(EditSpin1&)
Moveobject SpinEdit1&
ElseIf Getfocus(SpinEdit1&)
Moveobject Editspin1&
ElseIf Getfocus(spin2&)
Moveobject spin2&
ElseIf Equ(%key,4)
ElseIf Equ(%key,5)
' Hilfe
EndIf
Wend
|
|
|
|
|
|
#3 (Direktlink) |
|
Super-Moderator
![]() Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
|
Mir fehlen die PrfFellows, konnte nicht testen. Aber die HTCAPTION-Lösung funktioniert fast überall.
__________________
Gruß, Frank ![]() Webpage http://frabbing.bplaced.net mit Freeware - Tools, Spiele und Grafiken. |
|
|
|
|
|
#4 (Direktlink) |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Statics müssen den richtigen Stil haben, damit sie Meldungen weitergeben.
Code:
$H windows.ph
$H messages.ph
Declare appexit%
WindowStyle $003F
WindowTitle "anklicken und verschieben "
Window 207,114 - 771,611
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
Var Text& = Create("Text",%hwnd,"veschieb mich",10,10,100,24)
'#################################
'STATIC MUSS ~SS_NOTIFY STIL HABEN
'#################################
SetStyle Text&,GetStyle(Text&) | ~SS_NOTIFY
'#################################
WhileNot appexit%
WaitInput
If %key = 2
Dispose hdr#
appexit%=1
Endif
If (%message = ~WM_COMMAND) AND (&lParam = Text&)
UseCursor 5
~ReleaseCapture()
SendMessage(&lParam,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
EndIf
EndWhile
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
#5 (Direktlink) | |
|
Weiß worum´s geht
![]() Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
|
Danke Andreas !
Wer lesen kann ist echt im Vorteil Ausschnitt aus Platform SDK: Zitat:
|
|
|
|
|
|
|
|
#6 (Direktlink) |
|
Weiß worum´s geht
![]() Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
|
Static Funktioniert .
Groupbox geht nicht. |
|
|
|
|
|
#7 (Direktlink) |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Eine Groupbox ist ja auch kein Static sondern ein Button
Code:
$H windows.ph
$H messages.ph
STRUCT RECT = Left&,Righ&,Top&,Bottom&
Declare appexit%
WindowStyle $003F
WindowTitle "anklicken und verschieben "
Window 207,114 - 771,611
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
Var Text& = Create("Text",%hwnd,"veschieb mich",10,10,100,24)
Var Group& = Create("Groupbox",%hwnd,"veschieb mich",10,40,300,300)
'#################################
'STATIC MUSS ~SS_NOTIFY STIL HABEN
'#################################
SetStyle Text&,GetStyle(Text&) | ~SS_NOTIFY
'#################################
Var R# = New(RECT)
WhileNot appexit%
WaitInput
If %key = 2
Dispose hdr#
Dispose R#
appexit%=1
Endif
If (%message = ~WM_COMMAND) AND (&lParam = Text&)
UseCursor 5
~ReleaseCapture()
SendMessage(&lParam,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
ElseIf %message = ~WM_LBUTTONDOWN
~GetClientRect(Group&,R#)
~MapWindowPoints(Group&,%hwnd,R#,2)
If ~PtInRect(R#,LoWord(&lParam),HiWord(&lParam))
UseCursor 5
~ReleaseCapture()
SendMessage(Group&,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
endif
EndIf
EndWhile
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
#8 (Direktlink) |
|
Stammuser
![]() Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
|
Und so geht es mit jedem Control im Fenster, egal welcher Stil gesetzt ist.
Code:
$H windows.ph
$H messages.ph
STRUCT RECT = Left&,Righ&,Top&,Bottom&
Declare appexit%
WindowStyle $003F
WindowTitle "anklicken und verschieben "
Window 207,114 - 771,611
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
Var Text& = Create("Text",%hwnd,"veschieb mich",10,10,100,24)
Var Group& = Create("Groupbox",%hwnd,"veschieb mich",10,40,300,300)
Var Button& = Create("Button",%hwnd,"veschieb mich",140,10,100,24)
Var R# = New(RECT)
WhileNot appexit%
WaitInput
~EnumChildWindows(%hwnd,ProcAddr("MoveIt",2),MakeLong(%mousex,%mousey))
If %key = 2
Dispose hdr#
Dispose R#
appexit%=1
Endif
EndWhile
Proc MoveIt
Parameters wnd&,lParam&
~GetClientRect(wnd&,R#)
~MapWindowPoints(wnd&,%hwnd,R#,2)
If ~PtInRect(R#,LoWord(lParam&),HiWord(lParam&))
~ReleaseCapture()
UseCursor 5
SendMessage(wnd&,~WM_SYSCOMMAND,~SC_MOVE+1,0)
UseCursor 0
Return 0
endif
Return 1
EndProc
__________________
Gruss Andreas ______________________ http://www.ampsoft.eu Profan 3.3 - XProfanX2 Windows 95,98,ME,2000,XP Vista - Windows 7 32 / 64 Bit ASUS X93S - Intel Core I7 - NVIDIA GForce GT540M - 8GB Arbeitsspeicher |
|
|
|
|
|
#9 (Direktlink) |
|
Weiß worum´s geht
![]() Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
|
Hscroll und Vscroll funktionieren nicht.
Spinedit "spinnt". Beide Bestandteile lassen sich unabhängig voneinander verschieben. Das Auf und Ab - zählen funktioniert aber. Prima , daß dafür mal ein allgemeingültiger Code da ist |
|
|
|
![]() |
|
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Fan Control | Bengel | PC-Umbauten & Übertaktung | 4 | 02.04.2011 17:12 |
| Remote Control | Flikko | Software - Allgemein | 5 | 12.07.2007 06:55 |
| Fan Control | Raimond | Allgemein | 0 | 03.12.2005 23:42 |
| TCP/IP-Control | Genesis | C/C++, Visual C++, Visual C++.NET | 4 | 24.10.2004 13:07 |
| Remote Control | xarfax | Netzwerke | 2 | 19.08.2004 17:18 |