Results 1 to 3 of 3

Thread: Positionen & Totale in 2 Tabellen mit gleichen Spaltenbreiten

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default Positionen & Totale in 2 Tabellen mit gleichen Spaltenbreiten

    Quote Originally Posted by vainio
    Hallo zusammen

    Hier eine kleine Anregung zur Nutzung vom IdleHandler - vielleicht hilfts ja jemandem.

    Habe eben darüber nachgedacht, wie ich am besten eine Liste mit Positionen und einer Totalzeile in einer View anzeige, wobei die Anzahl Spalten sowie die Anzahl Positionen erst zur Laufzeit bekannt sind. So bin ich bei 2 Grids gelandet, welche durch eigene Prozeduren zuerst vorbereitet (Anz. Spalten) und dann gefüllt werden (DoFillGrid). Blieb die Problematik der zu synchronisierenden Spaltenbreiten - ein ideales Feld für den IdleHandler!

    Hier der Code zur Synchonisierung:
    Code:
    Use dfallent.pkg
    Use Windows.pkg
    
    Deferred_View Activate_oGridsNIdle for ;
    Object oGridsNIdle is a dbView
    
        Set Border_Style to Border_Thick
        Set Size to 101 384
        Set Location to 3 2
        Set Maximize_Icon to True
        Set Label to "Grids'n'Idles"
    
        Set Verify_Data_Loss_Msg to 0
        Set Verify_Exit_Msg      to 0
    
        Object oPosGrid is a Grid
            Set Location to 5 5
            Set Size to 70 377
            Set peAnchors to anAll
        
            Set Line_Width to 3 0 // size and Line_width MUST be set before any column properties
        
            Set Form_Width    0 to 47
            Set Header_Label  0 to "Column 1"
        
            Set Form_Width    1 to 47
            Set Header_Label  1 to "Column 2"
        
            Set Form_Width    2 to 47
            Set Header_Label  2 to "Column 3"
    
        End_Object
    
        Object oTotalGrid is a Grid
            Set Location to 83 5
            Set Size to 12 377
            Set Header_Visible_State to False
            Set Highlight_Row_State to True
            Set peAnchors to anBottomLeftRight
        
            Set Line_Width to 3 0 // size and Line_width MUST be set before any column properties
        
            Set Form_Width    0 to 47
            Set Header_Label  0 to ""
        
            Set Form_Width    1 to 47
            Set Header_Label  1 to ""
        
            Set Form_Width    2 to 47
            Set Header_Label  2 to ""
        
            Object oIdleHandler is a cIdleHandler
               Procedure OnIdle
                   Delegate Send pCheckColumns
               End_Procedure
            End_Object
            
            Procedure pCheckColumns
                Integer i iWidth1 iWidth2
                
                For i from 0 to 2
                    Get Form_Width of oPosGrid i to iWidth1
                    Get Form_Width of oTotalGrid i to iWidth2
                    If (iWidth1 <> iWidth2) Begin
                        Set Form_Width of oTotalGrid i to iWidth1
                    End
                Loop
            End_Procedure
            
            Procedure Activating Returns Integer
               Forward Send Activating
               Set pbEnabled of oIdleHandler to True
            End_Procedure
        
            Procedure Deactivating Returns Integer
               Set pbEnabled of oIdleHandler to False
               Forward Send DeActivating 
            End_Procedure
        
        End_Object
    
    
    Cd_End_Object

    Viele Grüsse
    Mika Vainio
    Vom: 24.08.2009 um 10:24

  2. #2
    Join Date
    Feb 2009
    Posts
    1,425

    Default Re: Positionen & Totale in 2 Tabellen mit gleichen Spaltenbreiten

    Hallo Mika,

    Danke für Deine Beiträge.
    Leider kann ich mich zur Zeit nicht mit dem neuem DBGrid beschäftigen. Ich komme aber später bestimmt darauf zurück.
    Ich will auch nicht, dass Du so ins Leere strampelst.
    Siehst ja auch, dass Viele reinschauen
    Regards,
    Dittmar Stiebitz

  3. #3
    Join Date
    Jul 2009
    Location
    Wiesbaden, Germany
    Posts
    245

    Default Re: Positionen & Totale in 2 Tabellen mit gleichen Spaltenbreiten

    Hallo Dittmar,

    danke für die Blumen, aber ich bin nicht Mika =)

    Das oben war nur ein Repost aus dem alten Forum. Ich schau mal, das ich noch einige Threads aus dem Google Cache rette, bevor auch die im Nirwana verschwinden.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •