Français
Forum

Buttonclick abfragen sur doppeltem Tabcontrol

 

Stephan
Sonneborn
allô Zusammen,

hat quelqu'un une Tip pour mich, comment je qui Buttons RESET et ARTIKEL SUCHEN abfragen peux?
KompilierenMarqueSéparation
'***************************************************************************************************
'* 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
FIN

Hab déjà diverse Lösungen ici im Forum probiert. Muss je qui Buttons réellement sur %HWND poser? ensuite peux je vous pas là positionieren, wohin vous maintenant sommes...
 
Schöne Grüße aus Wittgenstein
von Stephan

Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz
25.02.2011  
 



je peux qui Buttons weder avec qui souris encore avec qui clavier erreichen -

qui Controls laisser sich scheinbar so pas servir.

So peut sich naturellement aussi pas testen si bm_setState z.B. comme UserMessage ankommt.

Vermutlich klaust Du qui Messages dadurch cela Du SetParent(TabCtl&[1],TabControl&) anwendest.

je crois là hilft seulement qui Controls récente aufzubauen/ anzuordnen.
 
25.02.2011  
 




Stephan
Sonneborn
iF (25.02.11)
Vermutlich klaust Du qui Messages dadurch cela Du SetParent(TabCtl&,TabControl&) anwendest.


cela J'ai eu ici [...]  gelesen (Dein Beitrag vom 05.10.05/ 19:27)

Ursprünglich hatte ego so:
KompilierenMarqueSéparation
'***************************************************************************************************
'* 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
FIN
 
Schöne Grüße aus Wittgenstein
von Stephan

Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz
25.02.2011  
 



Teste la fois si es funktioniert si Du den Button sur solch Dialog mets et den Dialog sur Dein Contrôle:
KompilierenMarqueSéparation
cls
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>

 
25.02.2011  
 




Thomas
Freier

Hab déjà diverse Lösungen ici im Forum probiert. Muss je qui Buttons réellement sur %HWND poser? ensuite peux je vous pas là positionieren, wohin vous maintenant sommes...


non et oui, mais comment qui anderen Elemente sur den entsprechenden TabCtl&[&LOOP]
KompilierenMarqueSéparation
GROUPBOX&[2,&LOOP]  = CREATE("GROUPBOX" ,TabCtl&[&LOOP]    ,"Artikelsuche"     ,015,010,(WIDTH(TabCtl&[&LOOP]) -030),075)
>

et pas
KompilierenMarqueSéparation
BUTTON&[2,0,2]    = CREATE("BUTTON",TabControl&,"Artikel finden..."            ,875,060,100,030)
>

et so comment je es vois sur:
KompilierenMarqueSéparation
BUTTON&[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
25.02.2011  
 




Stephan
Sonneborn
allô Thomas,

merci pour den Tip. je werde wohl pas tambour herumkommen, sur chaque Tab qui beiden Buttons trop poser.

cela voulais je eigentlich vermeiden, là qui ensuite oui aussi alle einzeln abgefragt volonté doit. et je sais im Voraus pas, wieviele Tabs je erstellen muss.
qui Choiceboxen volonté pas dedans des Ereignishandlers abgefragt, mais seulement sur ihren aktuellen le contenu beim chercher eines Artikels abgefragt. cet Choiceboxen devoir aussi sur chaque Tab separat erstellt volonté, weil ensuite aussi chaque Tab trop chacun Zeit différent Suchkriterien behalten peux.

je muss mir ensuite plan avec einer Boucle im Ereignishandler aider:
KompilierenMarqueSéparation
ELSEIF CLICKED(BUTTON&[2,GETACTIVETAB(TabControl&)+1,3])'Reset

WHILELOOP 6

    SELECTSTRING(Edit&[2, GETACTIVETAB(TabControl&)+1, &LOOP],-1, "")

W
>
 
Schöne Grüße aus Wittgenstein
von Stephan

Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz
26.02.2011  
 




Thomas
Freier
bof, tu peux aussi seulement une Button prendre et ensuite den aktuellen Tab abfragen à entsprechende Aktion effectuer trop laisser.
qui Button sur:
KompilierenMarqueSéparation
'*-------------------------------------------------------------------------------------------------*
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.")
'*-------------------------------------------------------------------------------------------------*<

et irgendwie dem 2. Tabcontrol optique zuordenen. Habe sur qui Schnelle une "GROUPBOX" pris. si là un "Control" wäre (STATIC avec Border?), dass comment un Tabreiter aussieht, käme es wohl besser.

20 kB
Hochgeladen:26.02.2011
Downloadcounter74
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
26.02.2011  
 



[offtopic]@Stephan: cela Code-journée hatte pas funktioniert weil Du es avec
[\code statt
[/code geschlossen hattest ^ ^[/offtopic]
 
26.02.2011  
 




Stephan
Sonneborn
allô Thomas,

si je qui beiden Buttons au-dessus de des Tabcontrols anordnen serait, könnten vous peut-être. ensuite überlagert, si relativ viele Tabs angelegt volonté müssten (z.Z. sommes es 15).
Aussi vous êtes ensuite quelque chose aus dem Kontext Artikelsuche heraus.
mais Dein erstes Posting hat mir weitergeholfen. je hab wohl den forêt avant lauter Bäumen pas gesehn
 
Schöne Grüße aus Wittgenstein
von Stephan

Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz
27.02.2011  
 



répondre


Topictitle, max. 100 marque.
 

Systemprofile:

ne...aucune Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

s'il te plaît s'inscrire um une Beitrag trop verfassen.
 

Options du sujet

3.720 Views

Untitledvor 0 min.
RudiB.26.08.2022
H.Brill10.01.2019
Torsten Rümker02.06.2015
RICOSCH23.11.2014
plus...

Themeninformationen



Admins  |  AGB  |  Applications  |  Auteurs  |  Chat  |  protection des données  |  Télécharger  |  Entrance  |  Aider  |  Merchantportal  |  Empreinte  |  Mart  |  Interfaces  |  SDK  |  Services  |  Jeux  |  cherche  |  Support

un projet aller XProfaner, qui il y a!


Mon XProfan
Privé Nouvelles
Eigenes Ablageforum
Sujets-La liste de voeux
Eigene Posts
Eigene Sujets
Zwischenablage
Annuler
 Deutsch English Français Español Italia
Traductions

protection des données


Wir verwenden Cookies seulement comme Session-Cookies à cause de qui technischen Notwendigkeit et chez uns gibt es aucun Cookies de Drittanbietern.

si du ici sur unsere Webseite klickst ou bien navigierst, stimmst du unserer Erfassung de Informationen dans unseren Cookies sur XProfan.Net trop.

Weitere Informationen trop unseren Cookies et en supplément, comment du qui Kontrolle par-dessus behältst, findest du dans unserer nachfolgenden Datenschutzerklärung.


d'accordDatenschutzerklärung
je voudrais keinen Cookie