Forum | | | | Thomas Freier | Search a Solution, so to the Double click not immediate the actually date übernommen becomes. mandatory I first the Kalenderdatum the in the Item available adjust or a own Calendar create? too would I gladly, that the element to Datumswahl in the Calendar automatically destroy becomes. CompileMarkSeparation*****************************************************************
* Beispiel für die Funktion: GetControlParas(B#) *
* Autor: Normann Strübli *
*****************************************************************
Declare Listview&,Lvdll&,Mklick&,Element&
Declare LV_Handle&,LV_Column&,LV_Row&,LV_Xoffset&,LV_Yoffset&,LV_Width&,LV_Height&
Declare LV_Font&,LV_Orient&,LV_Text$,Edit_finish%,All_finish%,Eintrag%
declare HandlefromPoint&,mousepos#,HT_Info#,tab%
DIM MousePos#,10
DIM HT_Info#,16
Declare Font&
Declare Bereich#
Dim bereich#,320
Clear bereich#
DEF SetWindowPos(7) !USER32,SetWindowPos
DEF DeleteObject(1) !GDI32,DeleteObject
Def SetWindowLong(3) !USER32, SetWindowLongA
Def GetWindowLong(2) !USER32, GetWindowLongA
DEF GetKeyState(1) ! USER32, GetKeyState
dEF ScreenToClient(2) !USER32,ScreenToClient
DEF Key(1) @equ(@and(getkeystate(&(1)),$8000),$8000)
DEF getcursorpos(1) !USER32,GetCursorPos
DEF mouseposx(0) long(mousepos#,0)
DEF mouseposy(0) long(mousepos#,4)
Def SetEditNumeric(1) SetWindowLong(@&(1),-16,
Or(GetWindowLong(@&(1),-16),$2002))
$I Listview_Funktionen.inc
SETTRUECOLOR 1
Font& = @CREATE(FONT,NEW TIMES ROMAN,18,0,1,0,0)
Window 0,0-608,413
Windowtitle Beispiel: GetControlParas(B#)
lvdll&=usedll(bvr/Listview.dll)
listview&=CreateListView(%hwnd,%hinstance,0,Rgb(150,150,255),-1,$31)
SetFont listview&,Font&
InsertColumn listview&,Datum,100,2
SetItem listview&,11.02.2008
SetItem listview&,24.05.1997
SetItem listview&,14.08.1988
ShowListView(listview&,0,0,600,368)
InitMessages(%hwnd)
Proc Get_LvData
LV_Handle&=Long(bereich#,0) Listview Handle
LV_Column&=Long(bereich#,4) Index Spalte
LV_Row&=Long(bereich#,8) Index Zeile
LV_Xoffset&=Long(bereich#,12) X Offset
LV_Yoffset&=Long(bereich#,16) Y Offset
LV_Width&=Long(bereich#,20) Breite
LV_Height&=Long(bereich#,24) Höhe
LV_Font&=Long(bereich#,28) Font Handle
LV_Orient&=Long(bereich#,32) Textausrichtung
LV_Text$=String$(bereich#,64) Itemtext
LV_Height& = @SUB(LV_Height&,2) Kleine Größenkorrektur
if LV_Orient& = 1
LV_Orient& = 2
Elseif LV_Orient& = 2
LV_Orient& = 1
endif
if @gt(@add(LV_Xoffset&,LV_Width&),@Width(LV_Handle&)) Damit das Element nicht Außerhalb
LV_Width& = @sub(@Width(LV_Handle&),LV_Xoffset&) des Sichtbaren Bereiches der Spalte
endif erstellt wird
Endproc
Proc CursorPos
getcursorpos(mousepos#) Mausposition ermitteln
ScreenToClient(LV_Handle&,mousepos#) In Bildirmkoordinaten umrechen
Long Ht_info#,0=Long(mousepos#,0)
Long Ht_info#,4=Long(mousepos#,4)
Long Ht_info#,8=0
Long Ht_info#,12=0
Endproc
Proc Edit_Kalender
var Edit_Finish% = 0
var Element_E&=Create(DateEdit, LV_Handle&, , LV_Xoffset&,LV_Yoffset&,LV_Width&,LV_Height&)
SetWindowPos(Element_E&,-1,0,0,0,0,$13)
@Setfocus(Element_E&)
Whilenot Edit_Finish%
getmessage
case @ISKEY(27) : BREAK
If @ISKEY(13) Enter
LV_Text$ = @GetText$(Element_E&) Änderungen übernehmen
SetItemText(LV_HAndle&,addr(LV_Text$),LV_Column&,LV_Row&)
Edit_Finish% = 1
endif
wend
@DestroyWindow(Element_E&) Edit zerstören
Endproc
HAUPTPROGRAMM
While 1
waitinput
Case %key=2:BREAK
MKlick& = GetControlParas(Bereich#)Feldparameter auslesen
If @equ(Mklick&,1) Doppelklick links
Get_LvData Parameter auslesen
Edit_Kalender
endif
Wend
Dispose Bereich#
Dispose Mousepos#
Dispose HT_Info#
CloseMessages(%hwnd)
freedll lvdll&
$I Listview_Dispose.inc
DELETEOBJECT Font&
End
|
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/19/08 ▲ |
| |
| | | The code on my own is unfortunately not run. here had I me ZIP desired. |
| | | | |
| | Thomas Freier | The wish becomes erfüllt. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/20/08 ▲ |
| |
| | Jörg Sellmeyer | CompileMarkSeparation
Proc Edit_Kalender
var Edit_Finish% = 0
var Element_E&=Create(DateEdit, LV_Handle&, GetText$(LV_HAndle&,LV_Row&,LV_Column&), LV_Xoffset&,LV_Yoffset&,LV_Width&,LV_Height&)
SetWindowPos(Element_E&,-1,0,0,0,0,$13)
@Setfocus(Element_E&)
Whilenot Edit_Finish%
waitinput
getmessage
case @ISKEY(27) : BREAK
If @ISKEY(13) Enter
LV_Text$ = @GetText$(Element_E&) Änderungen übernehmen
SetItemText(LV_HAndle&,addr(LV_Text$),LV_Column&,LV_Row&)
Edit_Finish% = 1
endif
wend
@DestroyWindow(Element_E&) Edit zerstören
ENDPROC
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 02/20/08 ▲ |
| |
| | Thomas Freier | thanks Jörg. you were quick How the Wüstenwind. now I will it try, whether I it too with Feldsprüngen by the Button TAB How in the example Own Inputs list view hinbekomme. otherwise part I The input into Feldern. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/20/08 ▲ |
| |
| | | Hello Thomas so Have I the by me resolved - CompileMarkSeparation
PROC KALENDER_HILFE
Messagebox(Hier kann eine kurze Hilfe hin,Date$(2),64)
ENDPROC
PROC MGH_KALENDER
declare datum$
declare font0%,font00%,txt%,datumtext%
font0%=CREATE(FONT,ARIAL,14,0,0,0,0)
font00%=CREATE(FONT,ARIAL,16,6,0,0,0)
declare cal_EE%,cal_win&,calender&,lesen&,aus&,cal_hlp&
DECLARE d%,m%,y%
declare d$,m$,y$,dtp#
DEF getsystime(2) SendMessage(&(1),4097,0,&(2))
dim dtp#,20
PROC GETDATE
parameters chdl&
waitinput
getsystime(chdl&,dtp#)
d$=format$(00,word(dtp#,6))
m$=format$(00,word(dtp#,2))
y$=format$(0000,word(dtp#,0))
ENDPROC
WindowStyle 48
cal_win&=CREATE(WINDOW,%HWND,Datum auswählen...,200,100,205,300)
calender&=Control(SysMonthCal32,,$54000004,1,0,202,155,cal_win&,2000,%hinstance)
d%=CREATE(EDIT,cal_win&,d$,30,165,30,20)
SetFont d%,font0%
m%=CREATE(EDIT,cal_win&,m$,80,165,30,20)
SetFont m%,font0%
y%=CREATE(EDIT,cal_win&,y$,130,165,40,20)
SetFont y%,font0%
txt%=CREATE(TEXT,cal_win&,T T,35,185,20,20)
SetFont txt%,font0%
txt%=CREATE(TEXT,cal_win&,MM,85,185,30,20)
SetFont txt%,font0%
txt%=CREATE(TEXT,cal_win&,JJJJ,135,185,50,20)
SetFont txt%,font0%
lesen&=Create(Button,cal_win&,&Datum eintragen,10,205,180,25)
SetFont lesen&,font00%
cal_hlp&=Create(Button,cal_win&,?,10,240,50,20)
aus&=Create(Button,cal_win&,&Zurück,80,235,110,25)
SetFont aus&,font00%
cal_EE%=0
SetFocus(d%)
WHILENOT cal_EE%
WAITINPUT
IF CLICKED(lesen&) | (ISKEY(18) & Iskey(68))
d$=GETTEXT$(d%)
m$=GETTEXT$(m%)
y$=GETTEXT$(y%)
datum$=d$+m$+y$
IF datum$=
getdate(calender&)
datum$=d$+.+m$+.+y$
ENDIF
datum$=d$+.+m$+.+y$
DesTroyWindow(cal_win&)
SetText datumtext%,datum$
cal_EE%=1
dispose dtp#
ENDIF
IF CLICKED(aus&) | (ISKEY(18) & Iskey(90))
DesTroyWindow(cal_win&)
cal_EE%=1
dispose dtp#
SetActiveWindow(%HWnd)
ENDIF
CASE CLICKED(cal_hlp&):KALENDER_HILFE
ENDWHILE
ENDPROC
window (%MaxX+10),0-0,100
mgh_kalender
end
|
| | | | |
| | Thomas Freier | Horst, I sought not a Calendar. i want, that at edit one Listviewfeldes of/ one offered becomes. The Solution of Jörg is OK, if each one area edited go can. The problem comes, if I The row edit and TAB one area moreover jumping wants (see Appendix, here The Datumsfelder). I mach first once a Gedankenpause. but Perhaps has here already of/ one a Solution or a suggestion moreover. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/20/08 ▲ |
| |
| | Jörg Sellmeyer | i'd with AddHotKey(2000,9,0) the pressing the Tabtaste intercepting. then can You integrally aimed any activities distinguished. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 02/20/08 ▲ |
| |
| | Frank Abbing | Thomas, you see the as List view.dll-trouble? |
| | | | |
| | Thomas Freier | No, see I do not so. wished only a Listviewzeile How in the example Eigene_Eingaben edit, however with of/ one Datumsauswahl. Problems bereitete then getmessage . becomes the area access, becomes immediate the actually date übernommen, what naturally with one Existing date not tragbar was. will be with Jörgs Empfehlungen self something zusammenbauen. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/20/08 ▲ |
| |
| | Frank Abbing | OK. |
| | | | |
|
AnswerThemeninformationenthis Topic has 5 subscriber: |