Forum | | | | Stephan Sonneborn | Hello together,
has someone a hint for me, How I The Buttons RESET and ARTIKEL SEARCH inquire can? CompileMarkSeparation'***************************************************************************************************
'* Programmname: BOMGenerator *
'* Version : 1.00 *
'* Stand : 05.02.2011 *
'* Änderung : *
'**************************************************************+************************************
'***************************************************************************************************
' Schalter setzen *
'***************************************************************************************************
SET ("TRUECOLOR" , 1)
SET ("AUTOPAINT" , 2)
SET ("MESSAGEMODE", 1)
SET ("FASTMODE" , 0)
$IFDEF Interpreter
SET ("DEBUGMODE" , 1)
SET ("ERRORLEVEL" , 1)
$ELSE
SET ("DEBUGMODE" , 0)
SET ("ERRORLEVEL" , 0)
$ENDIF
'***************************************************************************************************
'***************************************************************************************************
' Header-Dateien laden *
'***************************************************************************************************
$H WINDOWS.PH
$H COMMCTRL.PH
'***************************************************************************************************
'***************************************************************************************************
' Include-Dateien laden *
'***************************************************************************************************
'***************************************************************************************************
'***************************************************************************************************
'* Eigene Funktionen *
'***************************************************************************************************
DEF CreateTextL(6) CONTROL("STATIC",@$(2),$50000200,@%(3),@%(4),@%(5),@%(6),@%(1),100, %HInstance, $0000)
DEF CreateTextC(6) CONTROL("STATIC",@$(2),$50000201,@%(3),@%(4),@%(5),@%(6),@%(1),101, %HInstance, $0000)
DEF CreateTextR(6) CONTROL("STATIC",@$(2),$50000202,@%(3),@%(4),@%(5),@%(6),@%(1),102, %HInstance, $0000)
DEF CreateTextTL(6) CONTROL("STATIC",@$(2),$50001300,@%(3),@%(4),@%(5),@%(6),@%(1),103, %HInstance, $0000)
DEF CreateTextTC(6) CONTROL("STATIC",@$(2),$50001301,@%(3),@%(4),@%(5),@%(6),@%(1),104, %HInstance, $0000)
DEF CreateTextTR(6) CONTROL("STATIC",@$(2),$50001302,@%(3),@%(4),@%(5),@%(6),@%(1),105, %HInstance, $0000)
DEF CreateEditL(6) CONTROL("EDIT" ,@$(2),$50000000,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
DEF CreateEditC(6) CONTROL("EDIT" ,@$(2),$50000001,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
DEF CreateEditR(6) CONTROL("EDIT" ,@$(2),$50000002,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
'*-------------------------------------------------------------------------------------------------*
DEF MIN(2) IF(@&(1) <= @&(2), @&(1), @&(2))
DEF MAX(2) IF(@&(1) > @&(2), @&(1), @&(2))
'*-------------------------------------------------------------------------------------------------*
DEF SetwindowTheme(3) !"uxtheme.dll", "SetWindowTheme"
DEF BringWindowToTop(1) !"user32", "BringWindowToTop"
DEF GetSysColor(1) !"USER32","GetSysColor"
'*-------------------------------------------------------------------------------------------------*
'***************************************************************************************************
'* Globale Variablen *
'***************************************************************************************************
DECLARE FlashBitmap&, FlashBitmapX%, FlashBitmapY%, SplashScreen&, Progressbar&[2]
DECLARE SearchPath$, IniFile$, PRGName$, Version$
DECLARE ItemFile$[32,3], ItemFiles% , ItemFilePath$, LastBOMPos&
DECLARE Column$[32], Columns%
DECLARE DLG&, HPic&, Pic& , Statusline&
DECLARE TabControl0&, TabCtl0&[2], TabControl&, TabCtl&[32], Gridbox&[2,32]
DECLARE Groupbox&[2,32], Text&[2,32,12], Edit&[2,32,12], Button&[2,32,12], Choicebox&[2,32,4]
DECLARE Excel&, Workbooks&, ExcelWnd&, ExcelBook&, ExcelSheet&, ExcelSheet$, ExcelSheetLines&
DECLARE Range&
DECLARE Font&[20], FontHeight%[2]
DECLARE LVDLL&, ImageList&
'***************************************************************************************************
ItemFile$[1, 1] = "Tab 1"
ItemFile$[2, 1] = "Tab 2"
ItemFile$[3, 1] = "Tab 3"
ItemFile$[4, 1] = "Tab 4"
ItemFile$[5, 1] = "Tab 5"
PrGName$ = "Demo"
'***************************************************************************************************
'* Prozeduren *
'***************************************************************************************************
'*-------------------------------------------------------------------------------------------------*
'* XP-Manifest für einzelne Controls abschalten *
'*-------------------------------------------------------------------------------------------------*
PROC DisableXPTheme
'*-------------------------------------------------------------------------------------------------*
PARAMETERS Hwnd&
'*-------------------------------------------------------------------------------------------------*
DECLARE Word#
DIM Word#, 2
SetwindowTheme(Hwnd&, Word#, Word#)
DISPOSE Word#
ENDPROC
'*-------------------------------------------------------------------------------------------------*
'************************************************************************************************
' Benutzerdialog *
'************************************************************************************************
PROC Dialog
DECLARE Dialogende% ,aux$, aux%, aux&, dx%, dy%, LastTab%
DECLARE Zeilen&, Zeile&, Zeile$, Found&
DECLARE LVItemText#, LVHandle&, SW#, DblClk&
DECLARE SuchBegriff$[6]
'*-------------------------------------------------------------------------------------------------*
DIM LVItemText#, 16384
DIM SW# , 9*4
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
'Dialogbox:
'*-------------------------------------------------------------------------------------------------*
dx% = %MAXX
dy% = %MAXY
DLG& = %HWND'CREATE("DIALOG" , %HWND,PrgName$ ,0,0,0,0)
'*-------------------------------------------------------------------------------------------------*
' Statuszeile:
LONG SW#, 0 = 050, 650, 700, 775, 825, 875, 925, dx%-1
Statusline& = CREATE("STATUSWINDOW", DLG& , "", 9, SW#)
SETTEXT Statusline&, 0, "Datei:"
SETTEXT Statusline&, 2, "Stand:"
SETTEXT Statusline&, 4, "Artikel:"
SETTEXT Statusline&, 6, "Treffer:"
SHOWWINDOW(DLG&, 0)
'*-------------------------------------------------------------------------------------------------*
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
'*-------------------------------------------------------------------------------------------------*
' Aktuelle Stückliste:
GROUPBOX&[0,1] = CREATE("GROUPBOX", DLG&, "Aktuelle Stückliste",015,010,(dx% - %BMPX - 050),055)
BUTTON&[0,1] = CREATE("BUTTON", DLG&, "wählen" ,(dx% - %BMPX - 130),027,080,030)
EDIT&[0,0] = CREATE("EDIT", DLG&, "" ,030,030,WIDTH(GROUPBOX&[0,1])-125,025)
CREATE("TOOLTIP", DLG&, Edit&[0,0], "Geben Sie hier den Namen (inkl. Pfad) \nder zu \
bearbeitenden Stückliste an.")
CREATE("TOOLTIP", DLG&, Button&[0,1], "Klicken Sie hier, um die zu \nbearbeitende Stückliste \
auszuwählen.")
'*-------------------------------------------------------------------------------------------------*
' Haupttabcontrol:
TabControl0& = CREATE("TABCTRL", DLG&, "Stückliste", 015, 075, dx% - 40, dy% - 075)
INSERTTAB(TabControl0&,1,"Artikelliste")
DisableXPTheme(TabControl0&)
WHILELOOP 2
TabCtl0&[&LOOP] = CONTROL("DIALOG","", $40081003,2,25,WIDTH(TabControl0&)-5, HEIGHT(TabControl0&)-29,TabControl0&,0,%HINSTANCE)
SHOWWINDOW(TabCtl0&[&LOOP],0)
WEND
SHOWWINDOW(TabCtl0&[2],1)
'*-------------------------------------------------------------------------------------------------*
'Stücklistentab:
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - Groupbox 1:
GROUPBOX&[2,0] = CREATE("GROUPBOX" , TabCtl0&[2],"Aktueller Artikel", 015,010,(WIDTH(TabCtl0&[2]) - 30),075)
TEXT&[2,0,1] = CREATE("TEXT" , GROUPBOX&[2,0], "Pos." , 015,018,030,017)
TEXT&[2,0,2] = CREATE("TEXT" , GROUPBOX&[2,0], "Menge" , 055,018,035,017)
TEXT&[2,0,3] = CREATE("TEXT" , GROUPBOX&[2,0], "Korr." , 095,018,035,017)
TEXT&[2,0,4] = CREATE("TEXT" , GROUPBOX&[2,0], "Einh." , 135,018,030,017)
TEXT&[2,0,5] = CREATE("TEXT" , GROUPBOX&[2,0], "Benennung 1" , 175,018,150,017)
TEXT&[2,0,6] = CREATE("TEXT" , GROUPBOX&[2,0], "Benennung 2" , 435,018,150,017)
TEXT&[2,0,7] = CREATE("TEXT" , GROUPBOX&[2,0], "Norm" , 695,018,100,017)
TEXT&[2,0,8] = CREATE("TEXT" , GROUPBOX&[2,0], "Werkstoff" , 805,018,100,017)
TEXT&[2,0,9] = CREATE("TEXT" , GROUPBOX&[2,0], "Artikel-Nr." , 915,018,080,017)
TEXT&[2,0,10] = CREATE("TEXT" , GROUPBOX&[2,0], "Gewicht" ,1005,018,080,017)
EDIT&[2,0,1] = CreateEditR (TabCtl0&[2] , "" , 030,050,030,025)
EDIT&[2,0,2] = CreateEditR (TabCtl0&[2] , "" , 070,050,030,025)
EDIT&[2,0,3] = CreateEditR (TabCtl0&[2] , "" , 110,050,030,025)
EDIT&[2,0,4] = CreateTextTL(GROUPBOX&[2,0], "" , 135,039,030,025)
EDIT&[2,0,5] = CreateTextTL(GROUPBOX&[2,0], "" , 175,039,250,025)
EDIT&[2,0,6] = CreateTextTL(GROUPBOX&[2,0], "" , 435,039,250,025)
EDIT&[2,0,7] = CreateTextTL(GROUPBOX&[2,0], "" , 695,039,100,025)
EDIT&[2,0,8] = CreateTextTL(GROUPBOX&[2,0], "" , 805,039,100,025)
EDIT&[2,0,9] = CreateTextTL(GROUPBOX&[2,0], "" , 915,039,080,025)
EDIT&[2,0,10] = CreateTextTL(GROUPBOX&[2,0], "" ,1005,039,080,025)
BUTTON&[2,0,1] = CREATE("BUTTON", TabCtl0&[2], "übergeben" ,WIDTH(TabCtl0&[2])-190,045,160,030)
CREATE("TOOLTIP", DLG&, Edit&[2,0,1] , "Geben Sie hier die Positionszahl in \nder zu \
bearbeitenden Stückliste an.")
CREATE("TOOLTIP", DLG&, Edit&[2,0,2] , "Geben Sie hier die Menge je Einheit an.")
CREATE("TOOLTIP", DLG&, Edit&[2,0,3] , "Geben Sie hier die Korrekturmenge je Einheit an.")
CREATE("TOOLTIP", DLG&, Button&[2,0,2], "Klicken Sie hier, um den Artikel an die \nbearbeitende \
Stückliste anzufügen.")
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - TabControl:
WINDOWSTYLE 80
TabControl& = CREATE("TABCTRL" , TabCtl0&[2], ItemFile$[1,1], 015, 100, (WIDTH(TabCtl0&[2]) - 30), dy%-300)
TabCtl&[1] = CREATE("WINDOW", TabControl&, "", 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29)
EXTERNAL("user32","SetParent",TabCtl&[1],TabControl&)
WHILELOOP 2, 5
INSERTTAB(TabControl&, &LOOP, ItemFile$[&LOOP, 1])
TabCtl&[&LOOP] = CREATE("WINDOW", TabControl&,"", 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29)
EXTERNAL("user32","SetParent",TabCtl&[&LOOP],TabControl&)
SHOWWINDOW(TabCtl&[&LOOP],0)
WEND
SHOWWINDOW(TabCtl&[1],1)
DisableXPTheme(TabControl&)
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - Groupbox 2:
WHILELOOP 1, 5
'*-------------------------------------------------------------------------------------------------*
GROUPBOX&[2,&LOOP] = CREATE("GROUPBOX" ,TabCtl&[&LOOP] ,"Artikelsuche" ,015,010,(WIDTH(TabCtl&[&LOOP]) -030),075)
TEXT&[2,&LOOP,1] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Suchbegriff:" ,015,018,180,020)
TEXT&[2,&LOOP,2] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Nennmaß:" ,205,018,090,020)
TEXT&[2,&LOOP,3] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Länge:" ,305,018,090,020)
TEXT&[2,&LOOP,4] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Norm:" ,405,018,120,020)
TEXT&[2,&LOOP,5] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Werkstoff:" ,535,018,120,020)
TEXT&[2,&LOOP,6] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Kategorie:" ,665,018,120,020)
EDIT&[2,&LOOP,1] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,015,040,180,100)
EDIT&[2,&LOOP,2] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,205,040,090,100)
EDIT&[2,&LOOP,3] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,305,040,090,100)
EDIT&[2,&LOOP,4] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,405,040,120,100)
EDIT&[2,&LOOP,5] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,535,040,120,100)
EDIT&[2,&LOOP,6] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,665,040,120,100)
WEND
'*-------------------------------------------------------------------------------------------------*
BUTTON&[2,0,2] = CREATE("BUTTON",TabControl&,"Artikel finden..." ,875,060,100,030)
BUTTON&[2,0,3] = CREATE("BUTTON",TabControl&,"Reset" ,1075,060,050,030)
CREATE("TOOLTIP", DLG&, Button&[2,0,2], "Klicken Sie hier, um Artikel zu finden.")
CREATE("TOOLTIP", DLG&, Button&[2,0,3], "Klicken Sie hier, um die Suchkriterien zu löschen.")
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
SETWINDOWPOS DLG& = (%MAXX-dx%)/2,(%MAXY-dy%)/2 - dx%,dy%; 0
SETWINDOWPOS StatusLine& = 0,0-0,0;0
SHOWWINDOW(DLG&, 1)
'*-------------------------------------------------------------------------------------------------*
SETFOCUS(DLG&)
Dialogende% = 0
'*-------------------------------------------------------------------------------------------------*
WHILENOT Dialogende%
'-----------------------------------------------------------------------------------------------'
' Reiter im TabControl0& gewechselt
WHILELOOP 2
SHOWWINDOW(TabCtl0&[&LOOP], GETACTIVETAB(TabControl0&) = (&LOOP-1))
WEND
'-----------------------------------------------------------------------------------------------'
' Reiter im TabControl& gewechselt
WHILELOOP ItemFiles%
SHOWWINDOW(TabCtl&[&LOOP], GETACTIVETAB(TabControl&) = (&LOOP-1))
WEND
'*-------------------------------------------------------------------------------------------------*
WAITINPUT
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
IF (%KEY = 2)'Beenden
Dialogende% = 2
'*-------------------------------------------------------------------------------------------------*
ELSEIF CLICKED(BUTTON&[2,0,3])'Reset
MESSAGEBOX(PRGName$, "Reset", 0)
'*-------------------------------------------------------------------------------------------------*
ELSEIF CLICKED(BUTTON&[0,1])'Stückliste wählen
aux$ = LOADFILE$("Bitte Stückliste wählen:", SearchPath$ + "*.xls")
IF aux$ <> ""
SETTEXT Edit&[0,0], aux$
SearchPath$ = SUBSTR$(aux$, 1, SUBSTR$(aux$, -1, "\\"))
WRITEINI IniFile$, "OPTIONS", "SearchPath" = SearchPath$
ENDIF
'*-------------------------------------------------------------------------------------------------*
ENDIF
'*-------------------------------------------------------------------------------------------------*
ENDWHILE
'*-------------------------------------------------------------------------------------------------*
DISPOSE LVItemText#
DISPOSE SW#
'*-------------------------------------------------------------------------------------------------*
DESTROYWINDOW(DLG&)
'*-------------------------------------------------------------------------------------------------*
ENDPROC
'*-------------------------------------------------------------------------------------------------*
'***************************************************************************************************
' Hauptprogramm *
'***************************************************************************************************
$IFDEF Interpreter
WINDOWSTYLE (1 | 2 | 8 | 16 | 512)
WINDOW 0,0-%MAXX,%MAXY
CLS GETSYSCOLOR(15)
$ELSE
WINDOWSTYLE (1 | 2 | 8 | 16 | 512)
WINDOW 0,0-%MAXX,%MAXY
SHOWWINDOW(%HWND,0)
font color="#ff8800"> $ENDIF
'+-------------------------------------------------------------------------------------------------+
dialog
END
Have already diverse Solutions here in the Forum probiert. Do I The Buttons objectively on %HWND lay? then can I tappt im dunkeln not there positionieren, where are they now... |
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/25/11 ▲ |
| |
| | | I can The Buttons weder with the mouse yet with the keyboard achieve -
The Controls can apparently so not valet.
so can itself naturally neither testing whether bm_setState z.B. as UserMessage ankommt.
Presumably klaust You The Messages therefore the You Entry /(TabCtl&[1],TabControl&) anwendest.
I faith there helps only The Controls new aufzubauen/ anzuordnen. |
| | | | |
| | Stephan Sonneborn | iF (25.02.11)
Presumably klaust You The Messages therefore the You Entry /(TabCtl&,TabControl&) anwendest.
the I had here [...] red (your Posting of 05.10.05/ 19:27)
original having ichs so: CompileMarkSeparation'***************************************************************************************************
'* Programmname: BOMGenerator *
'* Version : 1.00 *
'* Stand : 05.02.2011 *
'* Änderung : *
'**************************************************************+************************************
'***************************************************************************************************
' Schalter setzen *
'***************************************************************************************************
SET ("TRUECOLOR" , 1)
SET ("AUTOPAINT" , 2)
SET ("MESSAGEMODE", 1)
SET ("FASTMODE" , 0)
$IFDEF Interpreter
SET ("DEBUGMODE" , 1)
SET ("ERRORLEVEL" , 1)
$ELSE
SET ("DEBUGMODE" , 0)
SET ("ERRORLEVEL" , 0)
$ENDIF
'***************************************************************************************************
'***************************************************************************************************
' Header-Dateien laden *
'***************************************************************************************************
$H WINDOWS.PH
$H COMMCTRL.PH
'***************************************************************************************************
'***************************************************************************************************
' Include-Dateien laden *
'***************************************************************************************************
'***************************************************************************************************
'***************************************************************************************************
'* Eigene Funktionen *
'***************************************************************************************************
DEF CreateTextL(6) CONTROL("STATIC",@$(2),$50000200,@%(3),@%(4),@%(5),@%(6),@%(1),100, %HInstance, $0000)
DEF CreateTextC(6) CONTROL("STATIC",@$(2),$50000201,@%(3),@%(4),@%(5),@%(6),@%(1),101, %HInstance, $0000)
DEF CreateTextR(6) CONTROL("STATIC",@$(2),$50000202,@%(3),@%(4),@%(5),@%(6),@%(1),102, %HInstance, $0000)
DEF CreateTextTL(6) CONTROL("STATIC",@$(2),$50001300,@%(3),@%(4),@%(5),@%(6),@%(1),103, %HInstance, $0000)
DEF CreateTextTC(6) CONTROL("STATIC",@$(2),$50001301,@%(3),@%(4),@%(5),@%(6),@%(1),104, %HInstance, $0000)
DEF CreateTextTR(6) CONTROL("STATIC",@$(2),$50001302,@%(3),@%(4),@%(5),@%(6),@%(1),105, %HInstance, $0000)
DEF CreateEditL(6) CONTROL("EDIT" ,@$(2),$50000000,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
DEF CreateEditC(6) CONTROL("EDIT" ,@$(2),$50000001,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
DEF CreateEditR(6) CONTROL("EDIT" ,@$(2),$50000002,@%(3),@%(4),@%(5),@%(6),@%(1),106, %HInstance, $0200)
'*-------------------------------------------------------------------------------------------------*
DEF MIN(2) IF(@&(1) <= @&(2), @&(1), @&(2))
DEF MAX(2) IF(@&(1) > @&(2), @&(1), @&(2))
'*-------------------------------------------------------------------------------------------------*
DEF SetwindowTheme(3) !"uxtheme.dll", "SetWindowTheme"
DEF BringWindowToTop(1) !"user32", "BringWindowToTop"
DEF GetSysColor(1) !"USER32","GetSysColor"
'*-------------------------------------------------------------------------------------------------*
'***************************************************************************************************
'* Globale Variablen *
'***************************************************************************************************
DECLARE FlashBitmap&, FlashBitmapX%, FlashBitmapY%, SplashScreen&, Progressbar&[2]
DECLARE SearchPath$, IniFile$, PRGName$, Version$
DECLARE ItemFile$[32,3], ItemFiles% , ItemFilePath$, LastBOMPos&
DECLARE Column$[32], Columns%
DECLARE DLG&, HPic&, Pic& , Statusline&
DECLARE TabControl0&, TabCtl0&[2], TabControl&, TabCtl&[32], Gridbox&[2,32]
DECLARE Groupbox&[2,32], Text&[2,32,12], Edit&[2,32,12], Button&[2,32,12], Choicebox&[2,32,4]
DECLARE Excel&, Workbooks&, ExcelWnd&, ExcelBook&, ExcelSheet&, ExcelSheet$, ExcelSheetLines&
DECLARE Range&
DECLARE Font&[20], FontHeight%[2]
DECLARE LVDLL&, ImageList&
'***************************************************************************************************
ItemFile$[1, 1] = "Tab 1"
ItemFile$[2, 1] = "Tab 2"
ItemFile$[3, 1] = "Tab 3"
ItemFile$[4, 1] = "Tab 4"
ItemFile$[5, 1] = "Tab 5"
PrGName$ = "Demo"
'***************************************************************************************************
'* Prozeduren *
'***************************************************************************************************
'*-------------------------------------------------------------------------------------------------*
'* XP-Manifest für einzelne Controls abschalten *
'*-------------------------------------------------------------------------------------------------*
PROC DisableXPTheme
'*-------------------------------------------------------------------------------------------------*
PARAMETERS Hwnd&
'*-------------------------------------------------------------------------------------------------*
DECLARE Word#
DIM Word#, 2
SetwindowTheme(Hwnd&, Word#, Word#)
DISPOSE Word#
ENDPROC
'*-------------------------------------------------------------------------------------------------*
'************************************************************************************************
' Benutzerdialog *
'************************************************************************************************
PROC Dialog
DECLARE Dialogende% ,aux$, aux%, aux&, dx%, dy%, LastTab%
DECLARE Zeilen&, Zeile&, Zeile$, Found&
DECLARE LVItemText#, LVHandle&, SW#, DblClk&
DECLARE SuchBegriff$[6]
'*-------------------------------------------------------------------------------------------------*
DIM LVItemText#, 16384
DIM SW# , 9*4
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
'Dialogbox:
'*-------------------------------------------------------------------------------------------------*
dx% = %MAXX
dy% = %MAXY
DLG& = %HWND'CREATE("DIALOG" , %HWND,PrgName$ ,0,0,0,0)
'*-------------------------------------------------------------------------------------------------*
' Statuszeile:
LONG SW#, 0 = 050, 650, 700, 775, 825, 875, 925, dx%-1
Statusline& = CREATE("STATUSWINDOW", DLG& , "", 9, SW#)
SETTEXT Statusline&, 0, "Datei:"
SETTEXT Statusline&, 2, "Stand:"
SETTEXT Statusline&, 4, "Artikel:"
SETTEXT Statusline&, 6, "Treffer:"
SHOWWINDOW(DLG&, 0)
'*-------------------------------------------------------------------------------------------------*
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
'*-------------------------------------------------------------------------------------------------*
' Aktuelle Stückliste:
GROUPBOX&[0,1] = CREATE("GROUPBOX", DLG&, "Aktuelle Stückliste",015,010,(dx% - %BMPX - 050),055)
BUTTON&[0,1] = CREATE("BUTTON", DLG&, "wählen" ,(dx% - %BMPX - 130),027,080,030)
EDIT&[0,0] = CREATE("EDIT", DLG&, "" ,030,030,WIDTH(GROUPBOX&[0,1])-125,025)
CREATE("TOOLTIP", DLG&, Edit&[0,0], "Geben Sie hier den Namen (inkl. Pfad) \nder zu \
bearbeitenden Stückliste an.")
CREATE("TOOLTIP", DLG&, Button&[0,1], "Klicken Sie hier, um die zu \nbearbeitende Stückliste \
auszuwählen.")
'*-------------------------------------------------------------------------------------------------*
' Haupttabcontrol:
TabControl0& = CREATE("TABCTRL", DLG&, "Stückliste", 015, 075, dx% - 40, dy% - 075)
INSERTTAB(TabControl0&,1,"Artikelliste")
DisableXPTheme(TabControl0&)
WHILELOOP 2
TabCtl0&[&LOOP] = CONTROL("DIALOG","", $40081003,2,25,WIDTH(TabControl0&)-5, HEIGHT(TabControl0&)-29,TabControl0&,0,%HINSTANCE)
SHOWWINDOW(TabCtl0&[&LOOP],0)
WEND
SHOWWINDOW(TabCtl0&[2],1)
'*-------------------------------------------------------------------------------------------------*
'Stücklistentab:
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - Groupbox 1:
GROUPBOX&[2,0] = CREATE("GROUPBOX" , TabCtl0&[2],"Aktueller Artikel", 015,010,(WIDTH(TabCtl0&[2]) - 30),075)
TEXT&[2,0,1] = CREATE("TEXT" , GROUPBOX&[2,0], "Pos." , 015,018,030,017)
TEXT&[2,0,2] = CREATE("TEXT" , GROUPBOX&[2,0], "Menge" , 055,018,035,017)
TEXT&[2,0,3] = CREATE("TEXT" , GROUPBOX&[2,0], "Korr." , 095,018,035,017)
TEXT&[2,0,4] = CREATE("TEXT" , GROUPBOX&[2,0], "Einh." , 135,018,030,017)
TEXT&[2,0,5] = CREATE("TEXT" , GROUPBOX&[2,0], "Benennung 1" , 175,018,150,017)
TEXT&[2,0,6] = CREATE("TEXT" , GROUPBOX&[2,0], "Benennung 2" , 435,018,150,017)
TEXT&[2,0,7] = CREATE("TEXT" , GROUPBOX&[2,0], "Norm" , 695,018,100,017)
TEXT&[2,0,8] = CREATE("TEXT" , GROUPBOX&[2,0], "Werkstoff" , 805,018,100,017)
TEXT&[2,0,9] = CREATE("TEXT" , GROUPBOX&[2,0], "Artikel-Nr." , 915,018,080,017)
TEXT&[2,0,10] = CREATE("TEXT" , GROUPBOX&[2,0], "Gewicht" ,1005,018,080,017)
EDIT&[2,0,1] = CreateEditR (TabCtl0&[2] , "" , 030,050,030,025)
EDIT&[2,0,2] = CreateEditR (TabCtl0&[2] , "" , 070,050,030,025)
EDIT&[2,0,3] = CreateEditR (TabCtl0&[2] , "" , 110,050,030,025)
EDIT&[2,0,4] = CreateTextTL(GROUPBOX&[2,0], "" , 135,039,030,025)
EDIT&[2,0,5] = CreateTextTL(GROUPBOX&[2,0], "" , 175,039,250,025)
EDIT&[2,0,6] = CreateTextTL(GROUPBOX&[2,0], "" , 435,039,250,025)
EDIT&[2,0,7] = CreateTextTL(GROUPBOX&[2,0], "" , 695,039,100,025)
EDIT&[2,0,8] = CreateTextTL(GROUPBOX&[2,0], "" , 805,039,100,025)
EDIT&[2,0,9] = CreateTextTL(GROUPBOX&[2,0], "" , 915,039,080,025)
EDIT&[2,0,10] = CreateTextTL(GROUPBOX&[2,0], "" ,1005,039,080,025)
BUTTON&[2,0,1] = CREATE("BUTTON", TabCtl0&[2], "übergeben" ,WIDTH(TabCtl0&[2])-190,045,160,030)
CREATE("TOOLTIP", DLG&, Edit&[2,0,1] , "Geben Sie hier die Positionszahl in \nder zu \
bearbeitenden Stückliste an.")
CREATE("TOOLTIP", DLG&, Edit&[2,0,2] , "Geben Sie hier die Menge je Einheit an.")
CREATE("TOOLTIP", DLG&, Edit&[2,0,3] , "Geben Sie hier die Korrekturmenge je Einheit an.")
CREATE("TOOLTIP", DLG&, Button&[2,0,2], "Klicken Sie hier, um den Artikel an die \nbearbeitende \
Stückliste anzufügen.")
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - TabControl:
WINDOWSTYLE 80
TabControl& = CREATE("TABCTRL" , TabCtl0&[2], ItemFile$[1,1], 015, 100, (WIDTH(TabCtl0&[2]) - 30), dy%-300)
TabCtl&[1] = CONTROL("DIALOG","", $40081003, 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29,TabControl&,0,%HINSTANCE)
'TabCtl&[1] = CREATE("WINDOW", TabControl&,"", 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29)
'EXTERNAL("user32","SetParent",TabCtl&[1],TabControl&)
WHILELOOP 2, 5
INSERTTAB(TabControl&, &LOOP, ItemFile$[&LOOP, 1])
TabCtl&[&LOOP] =CONTROL("DIALOG","", $40081003, 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29,TabControl&,0,%HINSTANCE)
'TabCtl&[&LOOP] = CREATE("WINDOW", TabControl&,"", 2,25,WIDTH(TabControl&)-5, HEIGHT(TabControl&)-29)
'EXTERNAL("user32","SetParent",TabCtl&[&LOOP],TabControl&)
SHOWWINDOW(TabCtl&[&LOOP],0)
WEND
SHOWWINDOW(TabCtl&[1],1)
DisableXPTheme(TabControl&)
'*-------------------------------------------------------------------------------------------------*
'Artikellistentab - Groupbox 2:
WHILELOOP 1, 5
'*-------------------------------------------------------------------------------------------------*
GROUPBOX&[2,&LOOP] = CREATE("GROUPBOX" ,TabCtl&[&LOOP] ,"Artikelsuche" ,015,010,(WIDTH(TabCtl&[&LOOP]) -030),075)
TEXT&[2,&LOOP,1] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Suchbegriff:" ,015,018,180,020)
TEXT&[2,&LOOP,2] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Nennmaß:" ,205,018,090,020)
TEXT&[2,&LOOP,3] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Länge:" ,305,018,090,020)
TEXT&[2,&LOOP,4] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Norm:" ,405,018,120,020)
TEXT&[2,&LOOP,5] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Werkstoff:" ,535,018,120,020)
TEXT&[2,&LOOP,6] = CREATE("TEXT" ,GROUPBOX&[2,&LOOP],"Kategorie:" ,665,018,120,020)
EDIT&[2,&LOOP,1] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,015,040,180,100)
EDIT&[2,&LOOP,2] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,205,040,090,100)
EDIT&[2,&LOOP,3] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,305,040,090,100)
EDIT&[2,&LOOP,4] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,405,040,120,100)
EDIT&[2,&LOOP,5] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,535,040,120,100)
EDIT&[2,&LOOP,6] = CREATE("CHOICEBOX",GROUPBOX&[2,&LOOP],"" ,665,040,120,100)
WEND
'*-------------------------------------------------------------------------------------------------*
BUTTON&[2,0,2] = CREATE("BUTTON",TabControl&,"Artikel finden..." ,875,060,100,030)
BUTTON&[2,0,3] = CREATE("BUTTON",TabControl&,"Reset" ,1075,060,050,030)
CREATE("TOOLTIP", DLG&, Button&[2,0,2], "Klicken Sie hier, um Artikel zu finden.")
CREATE("TOOLTIP", DLG&, Button&[2,0,3], "Klicken Sie hier, um die Suchkriterien zu löschen.")
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
SETWINDOWPOS DLG& = (%MAXX-dx%)/2,(%MAXY-dy%)/2 - dx%,dy%; 0
SETWINDOWPOS StatusLine& = 0,0-0,0;0
SHOWWINDOW(DLG&, 1)
'*-------------------------------------------------------------------------------------------------*
SETFOCUS(DLG&)
Dialogende% = 0
'*-------------------------------------------------------------------------------------------------*
WHILENOT Dialogende%
'-----------------------------------------------------------------------------------------------'
' Reiter im TabControl0& gewechselt
WHILELOOP 2
SHOWWINDOW(TabCtl0&[&LOOP], GETACTIVETAB(TabControl0&) = (&LOOP-1))
WEND
'-----------------------------------------------------------------------------------------------'
' Reiter im TabControl& gewechselt
WHILELOOP ItemFiles%
SHOWWINDOW(TabCtl&[&LOOP], GETACTIVETAB(TabControl&) = (&LOOP-1))
WEND
'*-------------------------------------------------------------------------------------------------*
WAITINPUT
'*-------------------------------------------------------------------------------------------------*
'*-------------------------------------------------------------------------------------------------*
IF (%KEY = 2)'Beenden
Dialogende% = 2
'*-------------------------------------------------------------------------------------------------*
ELSEIF CLICKED(BUTTON&[2,0,3])'Reset
MESSAGEBOX(PRGName$, "Reset", 0)
'*-------------------------------------------------------------------------------------------------*
ELSEIF CLICKED(BUTTON&[0,1])'Stückliste wählen
aux$ = LOADFILE$("Bitte Stückliste wählen:", SearchPath$ + "*.xls")
IF aux$ <> ""
SETTEXT Edit&[0,0], aux$
SearchPath$ = SUBSTR$(aux$, 1, SUBSTR$(aux$, -1, "\\"))
WRITEINI IniFile$, "OPTIONS", "SearchPath" = SearchPath$
ENDIF
'*-------------------------------------------------------------------------------------------------*
ENDIF
'*-------------------------------------------------------------------------------------------------*
ENDWHILE
'*-------------------------------------------------------------------------------------------------*
DISPOSE LVItemText#
DISPOSE SW#
'*-------------------------------------------------------------------------------------------------*
DESTROYWINDOW(DLG&)
'*-------------------------------------------------------------------------------------------------*
ENDPROC
'*-------------------------------------------------------------------------------------------------*
'***************************************************************************************************
' Hauptprogramm *
'***************************************************************************************************
$IFDEF Interpreter
WINDOWSTYLE (1 | 2 | 8 | 16 | 512)
WINDOW 0,0-%MAXX,%MAXY
CLS GETSYSCOLOR(15)
$ELSE
WINDOWSTYLE (1 | 2 | 8 | 16 | 512)
WINDOW 0,0-%MAXX,%MAXY
SHOWWINDOW(%HWND,0)
> $ENDIF
'+-------------------------------------------------------------------------------------------------+
dialog
END
|
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/25/11 ▲ |
| |
| | | Teste time whether it functions if you whom Button on such dialog setting and the dialog on your Control: CompileMarkSeparationcls
var h&=control("DIALOG","",ws_tabStop | ws_child | ws_visible | ws_clipSiblings | ws_clipChildren,0,0,96,24,%hWnd,0,%hInstance,0)
var b&=create("button",h&,"Test",0,0,width(h&),height(h&))
while 1
waitinput
case clicked(b&) : end
/a>
|
| | | | |
| | Thomas Freier |
Have already diverse Solutions here in the Forum probiert. Do I The Buttons objectively on %HWND lay? then can I tappt im dunkeln not there positionieren, where are they now...
No and Yes, but as others items on the suitable TabCtl&[&LOOP] CompileMarkSeparation and not CompileMarkSeparationBUTTON&[2,0,2] = CREATE("BUTTON",TabControl&,"Artikel finden..." ,875,060,100,030) > and so How I it see on: CompileMarkSeparationBUTTON&[2,0,2] = CREATE("BUTTON",TabCtl&[1],"Artikel finden..." ,875,060,100,030)
BUTTON&[2,0,3] = CREATE("BUTTON",TabCtl&[1],"Reset" ,1075,060,050,030)e> |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/25/11 ▲ |
| |
| | Stephan Sonneborn | Hello Thomas,
thanks for hint. i'll well not thatswhy herumkommen, on each tab the two Buttons To lay.
the wished I really avoid, since the then indeed any particular quizzed go must. what about me white in the ahead not, wieviele Tabs I create must. The Choiceboxen go not inside the Ereignishandlers quizzed, separate only on ihren actually Content at Search one Artikels quizzed. These Choiceboxen should on each tab self-contained prepares go, because then too each tab To eachone Time different Suchkriterien keep can.
I must me then even with of/ one Loop in the Ereignishandler help: CompileMarkSeparation |
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/26/11 ▲ |
| |
| | Thomas Freier | Well, You can also only a Button take and then whom actually tab inquire around the suitable action perform To let. The Button on: CompileMarkSeparation'*-------------------------------------------------------------------------------------------------*
CREATE("GROUPBOX" , TabCtl0&[2],"", 1040,92,162,118)
BUTTON&[2,0,2] = CREATE("BUTTON",TabCtl0&[2],"Artikel finden..." ,1045,100,100,020)
BUTTON&[2,0,3] = CREATE("BUTTON",TabCtl0&[2],"Reset" ,1145,100,050,020)
CREATE("TOOLTIP", DLG&, Button&[2,0,2], "Klicken Sie hier, um Artikel zu finden.")
CREATE("TOOLTIP", DLG&, Button&[2,0,3], "Klicken Sie hier, um die Suchkriterien zu löschen.")
'*-------------------------------------------------------------------------------------------------*<
and somehow the 2. TabControl optisch zuordenen. have on The speedy a "GROUPBOX" taken. If there one "Control" would (STATIC with Border?), that like a Tabreiter looks, käme it well rather. |
| | | Gruß Thomas Windows XP SP2, XProfan X2 | 02/26/11 ▲ |
| |
| | | [offtopic]@Stephan: the code-day hadn't functions because You it with [\code instead of [/code closed had ^^[/offtopic] |
| | | | |
| | Stephan Sonneborn | Hello Thomas,
if I the two Buttons oberhalb the Tabcontrols space would, could tappt im dunkeln evtl. then overlay, if relatively many Tabs laid out go müssten (z.Z. are it 15). Also are you then something from the context Artikelsuche out. but your erstes Posting has me weitergeholfen. I Have well whom woods not sheer trees gesehn |
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 02/27/11 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |