Paules-PC-Forum.de Anzeige:

Microsoft Windows Intune: PC-Verwaltung und -Sicherheit in der Cloud: Updateverwaltung, Anti-Virus und vieles mehr!


Zurück   Paules-PC-Forum.de > Programmierung > XProfan

XProfan Alles rund um die Programmiersprache XProfan.

EM-Tippspiel

Paule bei Facebook


Paule bei Twitter


Letzte Forenthemen
Gehe zum ersten neuen Beitrag Algorithmen Teil IV...
Aufrufe: 3361, Antworten: 129
Gehe zum ersten neuen Beitrag Hamachi deinstallieren
Aufrufe: 58, Antworten: 5
Gehe zum ersten neuen Beitrag Bundesliga-Tippspiel Saision...
Aufrufe: 7670, Antworten: 187
Gehe zum ersten neuen Beitrag PPF - Spiel "Wörter weiter...
Aufrufe: 26970, Antworten: 4223
Gehe zum ersten neuen Beitrag PPF - Shoppingwahn
Aufrufe: 50963, Antworten: 1397
Gehe zum ersten neuen Beitrag Pc lahmt plötzlich
Aufrufe: 186, Antworten: 6
Gehe zum ersten neuen Beitrag PC fährt nicht mehr hoch.
Aufrufe: 0, Antworten: 0
Gehe zum ersten neuen Beitrag Von Live CD Windowspfad...
Aufrufe: 329, Antworten: 19
Gehe zum ersten neuen Beitrag Captur 2.2 (Snow Leo)
Aufrufe: 28, Antworten: 0
Gehe zum ersten neuen Beitrag Captur 2.3 (Lion)
Aufrufe: 34, Antworten: 0
Zeige:





Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 30.04.2011, 20:24   #1 (Direktlink)
Weiß worum´s geht
 
Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
Standard Control verschieben

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. Wer kann mir ein Beispiel machen
Ralph Theobald ist offline   Mit Zitat antworten
Werbung

Windows 7 Tipps und Tricks in Bildern

Alt 30.04.2011, 21:32   #2 (Direktlink)
Weiß worum´s geht
 
Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
Standard

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
Ralph Theobald ist offline   Mit Zitat antworten
Alt 30.04.2011, 22:36   #3 (Direktlink)
Super-Moderator
 
Benutzerbild von Frabbing
 
Registriert seit: 05.02.2009
Ort: Westliches NRW
Alter: 44
Beiträge: 5.094
Standard

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.
Frabbing ist gerade online   Mit Zitat antworten
Alt 01.05.2011, 07:33   #4 (Direktlink)
Stammuser
 
Benutzerbild von Andreas Miethe
 
Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
Standard

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
Andreas Miethe ist offline   Mit Zitat antworten
Alt 02.05.2011, 18:10   #5 (Direktlink)
Weiß worum´s geht
 
Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
Standard

Danke Andreas !

Wer lesen kann ist echt im Vorteil


Ausschnitt aus Platform SDK:
Zitat:
Applications often use static controls to label other controls or to separate a group of controls. Although static controls are child windows, they cannot be selected. Therefore, they cannot receive the keyboard focus and cannot have a keyboard interface. A static control that has the SS_NOTIFY style receives mouse input, notifying the parent window when the user clicks or double clicks the control.
Ralph Theobald ist offline   Mit Zitat antworten
Werbung

Windows 7 Tipps und Tricks in Bildern

Alt 02.05.2011, 18:21   #6 (Direktlink)
Weiß worum´s geht
 
Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
Standard

Static Funktioniert .

Groupbox geht nicht.
Ralph Theobald ist offline   Mit Zitat antworten
Alt 02.05.2011, 19:37   #7 (Direktlink)
Stammuser
 
Benutzerbild von Andreas Miethe
 
Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
Standard

Zitat:
Zitat von Ralph Theobald Beitrag anzeigen
Static Funktioniert .

Groupbox geht nicht.
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
Andreas Miethe ist offline   Mit Zitat antworten
Alt 02.05.2011, 20:01   #8 (Direktlink)
Stammuser
 
Benutzerbild von Andreas Miethe
 
Registriert seit: 08.02.2009
Ort: Bielefeld
Alter: 53
Beiträge: 428
Standard

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
Andreas Miethe ist offline   Mit Zitat antworten
Alt 02.05.2011, 22:25   #9 (Direktlink)
Weiß worum´s geht
 
Registriert seit: 03.01.2010
Ort: Saarland
Beiträge: 103
Standard

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
Ralph Theobald ist offline   Mit Zitat antworten
Antwort

  Paules-PC-Forum.de > Programmierung > XProfan

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen erlaubt, neue Themen zu verfassen.
Es ist Ihnen erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


Ä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



Alle Zeitangaben in WEZ +2. Es ist jetzt 12:44 Uhr.


Powered by vBulletin® Version 3.8.7 (Deutsch)
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Powered by vBCMS® 2.7.0 ©2002 - 2012 vbdesigns.de
(c) Paules-PC-Forum.de

::: Impressum :::

Search Engine Optimization by vBSEO 3.3.2