| |
|
|
 H.Brill | Como uno sin Drag&Drop en el PC-Alltag fast no mehr auskommt, debería dieses auch en XProfan (X3) necesariamente integriert voluntad. Sowohl innerhalb des eigenen Profanfenster + Controls (Listboxen usw.)como auch de Fremdprogrammen gedragte Archivos usw.
Zumindest 3 Formate wären me como wichtig : Textos, Archivos y Bilder.
Tal vez kann Roland como sí qué einsteiger o. User- freundliches remendar. Mit el entsprechenden API- Características y el CallBack-Características de XProfan dürfte algo como machbar ser. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 16.11.2015 ▲ |
|
|
|
|
 ByteAttack | Geht doch ya eigentlich relativ simplemente... KompilierenMarcaSeparación $H windows.ph
$H messages.ph
Def DragAcceptFiles(2) !"SHELL32","DragAcceptFiles"
Def DragFinish(1) !"SHELL32","DragFinish"
Def DragQueryFile(4) !"SHELL32","DragQueryFileA"
Declarar Anzahl&,Zähler&,PFilename#
Windowstyle 31
Windowtitle "Listbox con File Drag and Drop"' No a verwechseln con Plug&Pray
Ventana 0,0-640,440
var Filelistbox&=Crear("ListBox",%hwnd,"",20,20,500,300)
DragAcceptFiles(FileListbox&,1)
Usermessages ~wm_close,563' 563 <---- Drag&Drop
Sinestar encargado (%Umessage = ~wm_close) & (&uWnd = %hWnd)
WaitInput
IF %UMESSAGE=563' DragDrop Ereignis
DIM PFilename#,1024
ANZAHL&=DragQueryFile(&UWParam,$FFFFFFFF,PFilename#,1024)
Usecursor 2
Mientras que Zähler&<Anzahl&
Claro PFilename#
DragQueryFile(&UWParam,Zähler&,PFilename#,1024)
AddStrings(FileListbox&,String$(PFilename#,0))
Inc ZÄHLER&
EndWhile
Usecursor 0
Disponer PFilename#
DragFinish(&UWParam)
Endif
EndWhile
|
|
|
| |
|
|
|
 ByteAttack | con KompilierenMarcaSeparación kannst Usted entonces el Archivos bastante simplemente ermitteln, welcher Typ el es.
Ejemplo: KompilierenMarcaSeparación $H windows.ph
$H messages.ph
$H shellapi.ph
Usermessages ~wm_close,563' 563 <---- Drag&Drop
DEF PathFindExtension(1) ! "shlwapi","PathFindExtensionA"
DEF GetFileTitle(3) ! "COMDLG32","GetFileTitleA"
Declarar PFilename#,ext#
DIM PFilename#,1024
Dim ext#,20
Proc DateiSplit
Parámetros Expediente$
' Nur Expediente
var NurDatei$=Espacio$(1024)
GetFileTitle(Addr(Expediente$), Addr(NurDatei$), Len(NurDatei$))
NurDatei$=Trim$(NurDatei$)
' Extension
Claro ext#
ext# = PathFindExtension(addr(Expediente$))
var ext$ = cadena$(ext#,0)
' Nur Pfad
var NurPfad$=left$(Expediente$,len(Expediente$)-len(NurDatei$))
AddStrings(Filelistbox&,NurDatei$+"|"+NurPfad$+"|"+ext$)
ENDPROC
Proc DragDrop
Claro PFilename#
var ANZAHL&=~DragQueryFile(&UWParam,$FFFFFFFF,PFilename#,1024)
var Zähler&=0
Usecursor 2
Mientras que Zähler&<Anzahl&
Claro PFilename#
~DragQueryFile(&UWParam,Zähler&,PFilename#,1024)
DateiSplit String$(PFilename#,0)
Inc ZÄHLER&
EndWhile
Usecursor 0
~DragFinish(&UWParam)
ENDPROC
Windowstyle 24
Windowtitle "Drag and Drop"
Ventana ((%maxX/2)-260),((%maxY/2)-175)-520,350
Cls ~GetSysColor(15)
var listdef$="Datei;0;100;Pfad;0;310;Endung;0;60"
var Filelistbox&=Crear("GridBox",%hwnd,listdef$,0,5,5,500,300)
~DragAcceptFiles(%hwnd,1)
Sinestar encargado (%Umessage = ~wm_close) & (&uWnd = %hWnd)
WaitInput
If %UMESSAGE=563' DragDrop Ereignis
DragDrop
Endif
EndWhile
Disponer PFilename#
disponer ext#
|
|
|
| |
|
|
|
 H.Brill | Gracias, Yo meinte ahora más, daß el Aktionen (Drag y Drop) en el eigenen Programa stattfinden. Also z.B. Texto de uno Listbox a otro oder auch Bilder y Buttons en una Static.
Yo möchte gerne Bilder, el en uno Toolbar mittels ImageList adecuado voluntad, en una Static - Control kopieren. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 17.11.2015 ▲ |
|
|
|
|
 ByteAttack | Pero esto es ya heftig... Se puede el commctrl.ph nutzen en z.B. KompilierenMarcaSeparación para el Imageliste a nutzen, Aber en como weit al para una Toolbar nutzen kann, entzieht se me gerade. Yo setzt mich veces ran...  |
|
|
| |
|
|
|
 ByteAttack | soweit Yo el ahora en mi pequeño Gehirn verstanden habe, va daß qué Usted antes hast sólo una Rebar-Control... |
|
|
| |
|
|
|
 H.Brill | Naja, Yo pensamiento a algo como, como el meisten IDE's con un Visualdesigner anbieten, z.B. VisualBasic. Dort puede ser en efecto una Button anfassen y el Gitter platzieren.
Für mi Zwecke voluntad Yo auch así una Mapa de bits oder Icon anfassen puede y una Static con una Gitter punktgenau plazieren puede.
para Thema Toolbar : El Nummer des Icons en el ImageList bekommt uno sí ligeramente, si uno de %MenuItem z.B. 2000 abzieht, si el Menüpunkte en @Crear("Toolbar",...) de 2000 beginnen. Also soweit bin Yo ya. Mir fehlt sólo todavía el grafische Effekt de Drag&Drop.
PS: Como Drag&Drop laut API auch benutzerdefinierte Daten aktzeptiert, podría evtl. algo como posible ser. Bin sólo por desgracia, no así el Experte en Sachen API. (el con el Usermessage 563 Tuve auch todavía no gewußt). |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 17.11.2015 ▲ |
|
|
|
|
 ByteAttack | Yo como todavía una algo älteren Code, tal vez hilft el Usted sí... KompilierenMarcaSeparaciónUSERMESSAGES 16
$H Windows.ph
$H Commctrl.ph
'################ Globale Variables
var Bild&=create("HPIC", 0, "TOOLBAR32")
var IcoList& = create("ImageList",32,32,Bild&,rgb(192,192,192))
var AnzIcon%=73
var Zeilengrenze%=5
Declarar EndeY%,IstNeuX%,px%,py%,Temp$,MX%,MY%,GI%
Proc UpdateWindow
Case width(%hwnd,1)<800:SetWindowPos %hwnd=%WinLeft,%WinTop-800,height(%hwnd,1);0
Case height(%hwnd,1)<600:SetWindowPos %hwnd=%WinLeft,%WinTop-width(%hwnd,1),600;0
TB_AufBau
ENDPROC
'################################################################################################################# Toolbar aufbauen
'###################################################################################################
Proc TB_AufBau
Declarar WL%
ClearList GB&
USEP 0,1,~GetSysColor(15)
UseBrush 1,~GetSysColor(15)
Rectángulo 0,0-%maxX,42
USEP 0,1,~GetSysColor(22)
Line 0,42-%maxX,42
var AnzProZeile%=width(%hwnd)/39
if AnzIcon%<AnzProZeile%
WL%=AnzIcon%
más
WL%=AnzProZeile%
endif
var IcoX%=3
var IcoIdx%=0
WhileLoop WL%
DrawIcon IcoList&,IcoIdx%,IcoX%,4
AddStrings(GB&,Str$(IcoX%)+"|"+"4"+"|"+Str$(IcoIdx%))
IcoX%=IcoX%+39
Inc IcoIdx%
EndWhile
ENDPROC
Proc DragDrop
Mientras que %mousepressed'--Botón del ratón se mantenido
UseExtCursor %hInstance, "DRUCKER"
~ImageList_DragMove(%mousex,%mousey)
EndWhile
Título de la ventana "iconIndex: "+Str$(GI%)+" - "+Str$(%mousex)+"|"+Str$(%mousey)
ENDPROC
Proc DrawRaster
Parámetros Rasterweite%
USEP 0,1,0
UseBrush 1,0
var rx%=Rasterweite%
var ry%=Rasterweite%+60
Sinestar encargado ry%>=%maxY
Sinestar encargado rx%>=%maxX
SetPixel rx%,ry%,0
rx%=rx%+Rasterweite%
EndWhile
rx%=Rasterweite%
ry%=ry%+Rasterweite%
EndWhile
ENDPROC
'###################### HAUPTFENSTER
Ventana de Estilo 31
Título de la ventana "ToolBarTool V 1.01"
Ventana %maxX+5,5 - 800,600
Cls ~GetSysColor(16)
UseFont "Verdana",16,0,0,0,0
var font&=Crear("Font","Verdana",16,0,0,0,0)
SetDialogFont 1
var GB&=Crear("Grid",3,0)
var GBNeu&=Crear("Grid",3,0)
DrawRaster 10
UpdateWindow
SetWindowPos %hwnd=((%maxX/2)-400),((%maxY/2)-300)-800,600;0
var xOff&=~GetSystemMetrics(32)'-------Dicke des Fensterrandes
var yOff&=~GetSystemMetrics(4)+xOff&'--Höhe el Titelleiste + Fensterrand
' ################ HAUPTSCHLEIFE
Sinestar encargado %Umessage=16
WaitInput
If %Key=4
UpdateWindow
EndIf
WhileLoop 0, GetCount(GB&)-1
Temp$=GetString$(GB&,&bucle)
MX%=val(Substr$(Temp$,1,"|"))
MY%=val(Substr$(Temp$,2,"|"))
if Ratón(MX%,MY%-MX%+32,MY%+32)
GI%=val(Substr$(Temp$,3,"|"))
~ImageList_BeginDrag(IcoList&,GI%,(%mousex-xOff&-MX%),(%mousey-yOff&-MY%))
~ImageList_DragEnter(%hwnd,%mousex,%mousey)
DragDrop
~ImageList_EndDrag()
UseCursor 0
endif
EndWhile
EndWhile
deleteobject IcoList&
|
|
|
| |
|
|
|
 H.Brill | Gracias, el hilft me muy. KompilierenMarcaSeparación Das bringt me entonces el gewünschte Ergebnis.
PS: El Toolbar brauche Yo sí no necesariamente. Puedo el ImageListe en efecto así dibujar.
Muß me el código veces correcto reinziehen, así Yo weiß, qué como abgeht. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 17.11.2015 ▲ |
|
|
|
|
 ByteAttack | Sí - Es una älterer Code de me. tener ihn ahora nada adaptado.
 |
|
|
| |
|
|
|
 H.Brill | Jetzt muß Yo sólo todavía erreichen, daß uno unten auch el Position korrigieren kann. Man trifft sí no siempre igual en el Schwarze.
Also todavía una Drag&Drop innerhalb des Rasters.
Damit du verstehst, Yo mi : Etwa el Effekt, como beim Windows Solitärspiel. Wenn uno el Karte unten anhängt, rastet el unten una, si uno una etwaige Postion erreicht ha. |
|
|
| Benutze XPROFAN X3 + FREEPROFAN Wir sind die XProfaner. Sie werden von uns assimiliert. Widerstand ist zwecklos! Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.
Was die Borg können, können wir schon lange. | 17.11.2015 ▲ |
|
|
|
|
 Jörg Sellmeyer | Dafür dürfte entonces Between(....) el richtige Kandidat ser. Wenn du el Koordinaten para dein Raster hast (en un Array oder Grid), kannst du entonces con Between überprüfen, en welchem Raster du landest. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 17.11.2015 ▲ |
|
|
|