Español
Foro

Buttonclick abfragen en doppeltem Tabcontrol

 

Stephan
Sonneborn
¡Hola Zusammen,

ha alguien Tip para mich, Yo el Buttons RESET y ARTIKEL SUCHEN abfragen kann?
KompilierenMarcaSeparación
'***************************************************************************************************
'* 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
'+-------------------------------------------------------------------------------------------------+
Diálogo
FIN

Hab ya diverse Lösungen hier en el Foro probiert. Muss Yo el Buttons tatsächlich en %HWND legen? Dann kann Yo ellos no hay positionieren, wo ellos ahora son...
 
Schöne Grüße aus Wittgenstein
von Stephan

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



Puedo el Buttons weder con ratón todavía con el Tastatur erreichen -

el Controls dejar se scheinbar así no bedienen.

So lässt se natürlich auch no testen si bm_setState z.B. como UserMessage ankommt.

Vermutlich klaust Usted el Messages dadurch el Usted SetParent(TabCtl&[1],TabControl&) anwendest.

Yo glaube como hilft sólo el Controls neu aufzubauen/ anzuordnen.
 
25.02.2011  
 




Stephan
Sonneborn
IF (25.02.11)
Vermutlich klaust Usted el Messages dadurch el Usted SetParent(TabCtl&,TabControl&) anwendest.


Das Tuve hier [...]  gelesen (Su Contribución vom 05.10.05/ 19:27)

Ursprünglich hatte ego así:
KompilierenMarcaSeparación
'***************************************************************************************************
'* 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
'+-------------------------------------------------------------------------------------------------+
Diálogo
FIN
 
Schöne Grüße aus Wittgenstein
von Stephan

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



Teste veces si funktioniert si el Button en solch Diálogo setzt y el Diálogo en Su Control:
KompilierenMarcaSeparación
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 ya diverse Lösungen hier en el Foro probiert. Muss Yo el Buttons tatsächlich en %HWND legen? Dann kann Yo ellos no hay positionieren, wo ellos ahora son...


Nein y sí, aber como otro Elemente en el entsprechenden TabCtl&[&LOOP]
KompilierenMarcaSeparación
GROUPBOX&[2,&LOOP]  = CREATE("GROUPBOX" ,TabCtl&[&LOOP]    ,"Artikelsuche"     ,015,010,(WIDTH(TabCtl&[&LOOP]) -030),075)
>

y no
KompilierenMarcaSeparación
BUTTON&[2,0,2]    = CREATE("BUTTON",TabControl&,"Artikel finden..."            ,875,060,100,030)
>

y como Yo sehe en:
KompilierenMarcaSeparación
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
Hola Tomás,

danke para el Tip. Yo voluntad probablemente no tambor herumkommen, en cada Tab el beiden Buttons a legen.

Das Yo quería eigentlich vermeiden, como el entonces en efecto todos einzeln abgefragt voluntad necesario. Und Yo weiß en el Voraus no, wieviele Tabs Yo redactar muss.
El Choiceboxen voluntad no innerhalb des Ereignishandlers abgefragt, pero sólo en ihren aktuellen Inhalt beim Suchen uno Artikels abgefragt. Diese Choiceboxen debería auch en cada Tab separat erstellt voluntad, porque entonces auch cada Tab a cada Tiempo diferente Suchkriterien behalten kann.

Yo muss me entonces eben con uno Bucle en el Ereignishandler helfen:
KompilierenMarcaSeparación
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
Naja, du kannst auch sólo una Button nehmen y luego el aktuellen Tab abfragen a entsprechende Aktion ausführen que se.
El Button en:
KompilierenMarcaSeparación
'*-------------------------------------------------------------------------------------------------*
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.")
'*-------------------------------------------------------------------------------------------------*<

y irgendwie el 2. Tabcontrol optisch zuordenen. Posesiones en el Schnelle una "GROUPBOX" genommen. Wenn como una "Control" wäre (STATIC con Border?), dass como una Tabreiter aussieht, käme lo wohl mejor.

20 kB
Hochgeladen:26.02.2011
Ladeanzahl74
Descargar
 
Gruß Thomas
Windows XP SP2, XProfan X2
26.02.2011  
 



[offtopic]@Stephan: Das Code-Tag hatte no funktioniert porque Usted lo con
[\code en lugar de
[/code geschlossen había ^ ^[/offtopic]
 
26.02.2011  
 




Stephan
Sonneborn
Hola Tomás,

si yo el beiden Buttons oberhalb des Tabcontrols anordnen sería, könnten ellos evtl. entonces überlagert, si relativ viele Tabs creado voluntad müssten (z.Z. son lo 15).
Außerdem son ellos entonces algo de el Kontext Artikelsuche heraus.
Aber Su erstes Posting ha me weitergeholfen. Yo wohl el Wald antes lauter Bäumen no gesehn
 
Schöne Grüße aus Wittgenstein
von Stephan

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



Respuesta


Título del Tema, max. 100 Signo.
 

Systemprofile:

Kein Systemprofil creado. [anlegen]

XProfan:

 Contribución  Font  Smilies  ▼ 

Bitte registro en una Contribución a verfassen.
 

Tema opciones

3.691 Views

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

Themeninformationen



Admins  |  AGB  |  Applications  |  Autores  |  Chat  |  Política de Privacidad  |  Descargar  |  Entrance  |  Ayuda  |  Merchantportal  |  Pie de imprenta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Juegos  |  Búsqueda  |  Support

Ein Projekt aller XProfan, el lo son!


Mi XProfan
Privado Noticias
Eigenes Ablageforum
Temas-Merkliste
Eigene Beiträge
Eigene Temas
Zwischenablage
Cancelar
 Deutsch English Français Español Italia
Traducciones

Política de Privacidad


Wir uso Cookies sólo como Session-Cookies wegen el technischen Notwendigkeit y en uns hay no Cookies de Drittanbietern.

Wenn du hier en unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung de Informationen en unseren Cookies en XProfan.Net a.

Weitere Informationen a unseren Cookies y dazu, como du el Kontrolle darüber behältst, findest du en unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Yo möchte no Cookie