Changeset 563


Ignore:
Timestamp:
Feb 25, 2011, 5:05:54 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

GUI-Tools: SMBMON 2.1 core functionality

Location:
branches/guitools-2.0/smbmon-2.1
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-2.0/smbmon-2.1/smbmon.VRP

    r562 r563  
    77RunDirectory:
    88VRXWindow: __VREMainWindow,1,2180,3710,903,8010
    9 VRXWindow: __VRESectionListWindow,1,3589,11708,7938,3342
    10 VRXWindow: __VREToolsWindow,1,3211,9877,6486,1665
    11 VRXWindow: __VREWindListWindow,1,927,11708,2650,3324
     9VRXWindow: __VRESectionListWindow,1,3252,10455,7938,3493
     10VRXWindow: __VREToolsWindow,1,2108,1783,6486,1661
     11VRXWindow: __VREWindListWindow,1,602,10551,2650,3324
    1212UserFile: 1
    1313UserWindow: Main,1
     
    1717UserWindow: SW_4,1
    1818UserWindow: SW_5,1
    19 UserWindow: SW_6,1
  • branches/guitools-2.0/smbmon-2.1/smbmon.VRX

    r562 r563  
    9393#append U:\Develop\Samba\guitools-2.0\shared\nlv.vrs
    9494#append U:\Develop\Samba\guitools-2.0\shared\inittempdir.vrs
    95 #append U:\Develop\Samba\guitools-1.0\shared\sambainit.vrs
     95#append U:\Develop\Samba\guitools-2.0\shared\sambainit.vrs
     96#append U:\Develop\Samba\guitools-2.0\shared\smbtree.vrs
    9697*/
    9798return
     
    154155    ok = VRMethod("CN_smbtree","SetfieldAttr",MacFH,      "ReadOnly", 1)
    155156
    156 
     157    ok = VRMethod("CN_Users","SetFieldAttr", UsernameFH,  "VertJustification", "top")
     158 
    157159    /* add records for the 3 daemons */
    158160    smbdHandle = VRMethod("CN_Daemons", "Addrecord",, ,"smbd.exe","$41")
     
    170172return
    171173
     174/*:VRX         _GuessIcon
     175*/
     176_GuessIcon: procedure
     177    text = arg(1)
     178    select /* Printer guessing */
     179        when pos('LJ',text)      > 0 then res = '#65:PMWP.DLL'
     180        when pos('LASER',text)   > 0 then res = '#65:PMWP.DLL'
     181        when pos('EPSON',text)   > 0 then res = '#65:PMWP.DLL'
     182        when pos('PRINT',text)   > 0 then res = '#65:PMWP.DLL'
     183        when pos('PRT',text)     > 0 then res = '#65:PMWP.DLL'
     184        when pos('CANON',text)   > 0 then res = '#65:PMWP.DLL'
     185        when pos('MINOLTA',text) > 0 then res = '#65:PMWP.DLL'
     186        when pos('FAX',text)     > 0 then res = '#65:PMWP.DLL'
     187        when pos('LEXMARK',text) > 0 then res = '#65:PMWP.DLL'
     188        when pos('IPC$',text)    > 0 then res = '#59:PMWP.DLL'
     189        otherwise res = "#34:PMWP.DLL"
     190    end
     191return res
     192
    172193/*:VRX         _GUIInit
    173194*/
     
    262283    if options.!debug = "" then options.!debug = 0
    263284
     285    /* For Users page in case connections.tdb is not initialised */
     286    IgnoreSmbNoInit = 1
     287
     288    /* For Browse page */
     289    FirstRun = 1
     290
     291    /* For Refresh tree display code */
     292    RefreshMode =""
     293
     294    smbdpidhandle.0 = 0
     295    nmbdpidhandle.0 = 0
     296    winbpidhandle.0 = 0
     297
     298    prevsmbdct = 0
     299    prevnmbdct = 0
     300    prevwinbct = 0
     301
    264302    if options.!debug == 1 THEN SAY time()' _INIRead() done'
    265303return
     
    339377return
    340378
     379/*:VRX         _Refresh
     380*/
     381_Refresh:
     382    if options.!debug == 1 THEN SAY time()" _Refresh() started"
     383    ok = VRSet("TM_refresh","Enabled", 0)
     384    SmbNoInit = 0
     385
     386    rfout = TempDir'refresh.out'
     387    rferr = TempDir'refresh.err'
     388
     389    call _SambaExe samba.!smbd' -V --debuglevel=0 2>'rferr' 1>'rfout
     390
     391    SambaVer = "Samba "||strip(linein(rfout))
     392    if options.!debug == 1 THEN SAY '  smbd.exe:  "'SambaVer'"'
     393    ok = stream(rfout,'c','close')
     394
     395    call _SambaExe samba.!smbstatusexe' smbd 'DebugLevel' 2>'rferr' 1>'rfout
     396
     397    /* First line is usually empty */
     398    Hdr      = linein(rfout)
     399    SambaStVer = strip(linein(rfout)) /* we can detect version mismatches here */
     400    if options.!debug == 1 THEN SAY '  smbstatus: "'SambaStVer'"'
     401
     402    select
     403        when pos('not initialised',SambaStVer) > 0 then do
     404            SambaVer = SambaVer||" (Init)"
     405            SmbNoInit = 1
     406        end
     407        when translate(SambaStVer) <> translate(SambaVer) then SambaVer = SambaVer||" (Hybrid)"
     408        otherwise nop
     409    end
     410
     411    Ok = VRSet("Main", "Caption", SambaVer' - 'NLVGetMessage(146))
     412
     413    /* Active User */
     414    Hdr1 = linein(rfout)
     415    /* say '  1:'hdr1 */
     416    Hdr2 = linein(rfout)
     417    /* say '  2:'hdr2 */
     418    Zeile = linein(rfout)
     419    if options.!debug == 1 THEN say '    'Zeile
     420    if SmbNoInit then do
     421        call lineout samba.!msg, SambaStVer
     422        call lineout samba.!msg, Hdr1
     423        call lineout samba.!msg, Hdr2
     424        call lineout samba.!msg, Zeile
     425        ok = stream(samba.!msg,'c','close')
     426        if IgnoreSmbNoInit then do
     427            call _SambaShowMsg
     428            IgnoreSmbNoInit = 0
     429        end
     430    end
     431
     432    if options.!debug == 1 THEN SAY '  SmbNoInit = 'SmbNoInit
     433
     434    /* Users page */
     435    ok = VRSet("CN_Users","Painting", 0)
     436    ok = VRMethod("CN_Users", "RemoveRecord", "ALL")
     437
     438    Username.0 = 0
     439    IP.0       = 0
     440    Group.0    = 0
     441    I = 0
     442    if \SmbNoInit then do
     443        do while Zeile <> ''
     444            parse var Zeile UPID Username Group Machine IP
     445            I = I + 1
     446            UPID.I = UPID
     447            Username.I = Username
     448            Group.I = Group
     449            IP = strip(IP)
     450            parse var IP '('IP.I')'
     451            RecHandle = VRMethod("CN_Users", "Addrecord")
     452            ok = VRMethod("CN_Users", "SetFieldData", RecHandle, UIconH, "$44", UPIDFH, UPID, UsernameFH, Username, GroupFH, Group, UMachineFH, Machine, UIPAdrFH, IP.I)
     453            Zeile = linein(rfout)
     454        end   
     455    end
     456    Username.0 = I
     457    Group.0 = I
     458    UPID.0 = I
     459    ok = VRSet("CN_Users","Painting", 1)
     460
     461    /* Active Services page */
     462    Hdr = linein(rfout)
     463    Hdr = linein(rfout)
     464    I = 0
     465    Zeile = linein(rfout)
     466    ok = VRSet("CN_Service","Painting", 0)
     467    ok = VRMethod("CN_Service", "RemoveRecord", "ALL")
     468    do while Zeile <> ''
     469        parse var Zeile Service SPId Machine Connected
     470        I = I + 1
     471        SPid.I    = SPid
     472        Machine.I = Machine
     473        Service.I = Service
     474        Icon = _GuessIcon(Service.I)
     475
     476        Connected = strip(Connected)
     477        T. = ""
     478        parse var Connected T.WDay T.Month T.DoM T.TimeoD T.Year
     479        Connected = T.TimeoD', 'T.WDay' 'T.DoM' 'T.Month' 'T.Year
     480
     481        RecHandle = VRMethod("CN_Service", "Addrecord")
     482        ok = VRMethod("CN_Service", "SetFieldData", RecHandle, SIconH, Icon, ServiceFH, Service, SPIDFH, SPID, SMachineFH, Machine, ConnectedFH, Connected)
     483        Zeile = linein(rfout)
     484    end   
     485    SPid.0    = I
     486    Machine.0 = I
     487    Service.0 = I
     488
     489    ok = VRSet("CN_Service","Painting", 1)
     490
     491    /* Open Files */
     492    Hdr = linein(rfout)
     493    Hdr = linein(rfout)
     494    Hdr = linein(rfout)
     495
     496    Zeile = linein(rfout)
     497    ok = VRSet("CN_Files","Painting", 0)
     498    ok = VRMethod("CN_Files", "RemoveRecord", "ALL")
     499    File.0 = 0
     500    FPID.0 = 0
     501    do while Zeile <> ''
     502        parse var Zeile FPid Uid DenyMode Access RW Oplock Sharepath Rest
     503        TimeDate = right(rest,25)
     504        Name = strip(left(Rest,max(length(Rest)-25),1))
     505        I = I + 1
     506        sharepath = strip(translate(left(sharepath,1))||translate(substr(SharePath,2),'\','/'),'T','\')
     507        Username = UID
     508        do J = 1 to UPID.0
     509            if FPID = UPID.J then do
     510                Username = Username.J
     511                leave
     512            end
     513        end
     514        File = SharePath||'\'||translate(Name,'\','/')
     515        File.I = File
     516        FPID.I = FPID
     517        TimeDate = strip(TimeDate)
     518        if options.!debug == 1 THEN say Timedate
     519        T. = ""
     520        parse var TimeDate T.WDay T.Month T.DoM T.TimeoD T.Year
     521        FileTime = T.TimeoD
     522        FileDate = T.WDay' 'T.DoM' 'T.Month' 'T.Year
     523        RecHandle = VRMethod("CN_Files", "Addrecord")
     524        ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FPidFH, FPid, FileFH, File, FUserFH, Username, UidFH, Uid, DenyModeFH, DenyMode,  AccessFH, Access, RWFH, RW)
     525        ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FIconH, "$45", TimeFH, FileTime, DateFH, FileDate, OplockFH, Oplock, SharePathFH, Sharepath, NameFH, Name)
     526        Zeile = linein(rfout)
     527    end   
     528    File.0 = I
     529    FPID.0 = I
     530
     531    ok = stream(rfout, 'c','close')
     532    ok = stream(rferr, 'c','close')
     533    ok = SysFileDelete(rfout)
     534    ok = SysFileDelete(rferr)
     535
     536    call _RefreshDaemons
     537
     538    ok = VRSet("CN_Files","Painting", 1)
     539
     540    if VRGet("Main", "WindowState") = "Minimized"
     541        then ok = VRSet("TM_Refresh","Delay", settings.!intervallMin * 1000)   
     542        else ok = VRSet("TM_Refresh","Delay", settings.!intervall * 1000)
     543
     544    ok = VRSet("TM_refresh","Enabled", 1)
     545    if options.!debug == 1 THEN SAY time()" _Refresh() done"
     546return
     547
     548/*:VRX         _RefreshDaemons
     549*/
     550_RefreshDaemons:
     551    if options.!debug == 1 THEN SAY time()' _RefreshDaemons() started'
     552    ok = VRSet("CN_Daemons","Painting", 0 )
     553
     554    call VRSet VRWindow(), 'Pointer', 'Wait'
     555
     556    do I = 1 to smbdpidhandle.0
     557        ok = VRMethod("CN_Daemons", "RemoveRecord", smbdpidhandle.I )
     558    end
     559
     560    do I = 1 to nmbdpidhandle.0
     561        ok = VRMethod("CN_Daemons", "RemoveRecord", nmbdpidhandle.I )
     562    end
     563
     564    do I = 1 to winbpidhandle.0
     565        ok = VRMethod("CN_Daemons", "RemoveRecord", winbpidhandle.I )
     566    end
     567
     568    Running = _SambaRunning()
     569
     570    call VRSet VRWindow(), 'Pointer', '<default>'   
     571
     572    smbdpids = pids.!smbd
     573    nmbdpids = pids.!nmbd
     574    winbpids = pids.!nmbd
     575
     576    smbdRunning = running.!smbd
     577    nmbdRunning = running.!nmbd
     578    winbRunning = running.!winb
     579
     580    if smbdRunning then do
     581        ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, smbdpids)
     582        ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$46")
     583        smbdpidhandle.0 = words(smbdpids)
     584        if options.!debug = 1 then do
     585            if smbdpidhandle.0 > prevsmbdct then do
     586                prevsmbdct = smbdpidhandle.0
     587                call beep 880*1, 10
     588                call beep 880*2, 10
     589                call beep 880*4, 10
     590            end
     591            if smbdpidhandle.0 < prevsmbdct then do
     592                prevsmbdct = smbdpidhandle.0
     593                call beep 880*4, 10
     594                call beep 880*2, 10
     595                call beep 880*1, 10
     596            end
     597        end
     598
     599        do I = 1 to words(smbdpids)
     600            Username = ""
     601            do J = 1 to UPID.0
     602                if UPID.J = word(smbdpids,I) then do
     603                    Username = ' 'Username.J
     604                    leave
     605                end
     606            end
     607            smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , 'PID 'word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")
     608            if Username <> "" then do
     609                smbdpidhandle.I.user = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I, , Username, "$44")
     610                do J = 1 to FPID.0
     611                    if FPID.J = word(smbdpids,I) then do
     612                        dummyHandle = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I.user, , File.J, "$45")
     613                    end
     614                end
     615            end
     616        end
     617    end
     618    else do
     619        ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
     620        ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$47")
     621        if options.!debug = 1 then do
     622            if prevsmbdct > 0 then do
     623                prevsmbdct = 0
     624                call beep 880*4, 10
     625                call beep 880*2, 10
     626                call beep 880*1, 10
     627            end
     628        end
     629    end
     630
     631    if nmbdRunning then do
     632        ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, nmbdpids)
     633        ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$46")
     634        nmbdpidhandle.0 = words(nmbdpids)
     635        do I = 1 to words(nmbdpids)
     636            nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , 'PID 'word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")
     637        end
     638    end
     639    else do
     640        ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
     641        ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$47")
     642    end
     643
     644    if winbRunning then do
     645        ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(40), DPidsFH, winbpids)
     646        ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$46")
     647        winbpidhandle.0 = words(winbpids)
     648        do I = 1 to words(winbpids)
     649            winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , 'PID 'word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")
     650        end
     651    end
     652    else do
     653        ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
     654        ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$47")
     655    end
     656
     657/*  if \(smbdrunning|nmbdrunning|winbrunning) then do
     658        ok = VRSet("IPB_Start", "Visible", 1)
     659        ok = VRSet("IPB_Stop", "Visible", 0)
     660        ok = VRSet("IPB_ReStart", "Enabled", 0)
     661        ok = VRSet("IPB_ReLoad", "Enabled", 0)
     662    end
     663    else do
     664        ok = VRSet("IPB_Start", "Visible", 0)
     665        ok = VRSet("IPB_Stop", "Visible", 1)
     666        ok = VRSet("IPB_ReStart", "Enabled", 1)
     667        ok = VRSet("IPB_ReLoad", "Enabled", 1)
     668    end */
     669
     670    ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
     671    ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
     672    ok = VRSet("CN_Daemons","Painting", 1 )
     673    if Running then call _SambaUptime
     674    if options.!debug == 1 THEN SAY time()' _RefreshDaemons() done'
     675return
     676
     677/*:VRX         _SambaExe
     678*/
     679_SambaExe: procedure expose samba. options. settings.
     680    if options.!debug == 1 then say time()' _SambaExe() started.'
     681    cmdline = arg(1)
     682    if options.!debug == 1 THEN SAY '  Executing "'cmdline'"'
     683    address cmd cmdline
     684    if options.!debug == 1 then say time()' _SambaExe() done.'
     685return
     686
    341687/*:VRX         _SambaFindPIDFile
    342688*/
     
    349695return
    350696
     697/*:VRX         _SambaShowError
     698*/
     699_SambaShowError: procedure expose samba. settings. options.
     700    I = 0
     701    do while lines(samba.!error) <> 0
     702        I = I + 1
     703        smberr.I = linein(samba.!error)
     704    end
     705    ok = stream(Samba.!error,"c","close")
     706    smberr.0 = I
     707    Buttons.1 = "OK" /* NLVGetMessage(2) */
     708    Buttons.0 = 1
     709    id = VRMessageStem( VRWindow(), "smberr.", VRGet("Main", "Caption") , "Error", "Buttons.", buttons.1, buttons.1 )
     710    ok = SysFileDelete(Samba.!error)   
     711return
     712
     713/*:VRX         _SambaShowMsg
     714*/
     715_SambaShowMsg: procedure expose samba. settings. options.
     716    if options.!debug == 1 THEN SAY time()" _SambaShowMsg started"
     717    skipWords = arg(1)
     718    skip.0 = words(skipWords)
     719    do J = 1 to skip.0
     720        skip.J = translate(word(skipWords,J))
     721    end
     722    I = 0
     723    do while lines(samba.!msg) <> 0
     724        msgline = linein(samba.!msg)
     725        SkipIt = 0
     726        do J = 1 to skip.0
     727            if pos(skip.J,translate(msgline)) > 0 then do
     728                skipit = 1
     729                leave
     730            end
     731        end
     732        if \SkipIt then do
     733            I = I + 1
     734            smbmsg.I = strip(MsgLine)
     735        end
     736    end
     737    ok = stream(Samba.!msg,"c","close")
     738    say "  stream close "Samba.!msg" = "ok
     739    smbmsg.0 = I
     740    if smbmsg.0 > 0 then do
     741        Buttons.1 = "OK" /* NLVGetMessage(2) */
     742        Buttons.0 = 1
     743        id = VRMessageStem( VRWindow(), "smbmsg.", VRGet("Main", "Caption") , "I", "Buttons.", buttons.1, buttons.1 )
     744    end
     745    ok = SysFileDelete(Samba.!msg)
     746    say "  Delete "Samba.!msg" = "ok
     747    if options.!debug == 1 THEN SAY time()" _SambaShowMsg done"
     748return
     749
     750/*:VRX         _SambaUptime
     751*/
     752_SambaUptime:
     753    if options.!debug == 1 then say time()' _SambaUptime() started'
     754    call _SambaFindPIDfile
     755    if nmbdpidfile = "" then do
     756        ok = VRset("CN_Daemons", "Caption", NLVGetMessage(42)||" "||NLVGetMessage(41))
     757        return
     758    end
     759
     760    StartTime = SysGetFileDateTime(nmbdpidfile)
     761    if StartTime = -1 then return
     762
     763    NowTime   = substr(date('S'),1,4)'-'substr(date('S'),5,2)'-'substr(date('S'),7,2)' 'time()
     764
     765 /* StartTime = "2007-12-31 00:00:00"
     766    NowTime   = "2008-03-05 08:59:50" */
     767
     768    if options.!debug == 1 then do
     769        say '  started at "'StartTime'"'
     770        say '  now it is  "'NowTime'"'
     771    end
     772
     773    doM.0 = 12
     774    doM.1 = 31; doM.2 = 28; doM.3 = 31; doM.4 = 30; doM.5 = 31; doM.6 = 30;
     775    doM.7 = 31; doM.8 = 31; doM.9 = 30; doM.10= 31; doM.11= 30; doM.12= 31
     776
     777    parse var StartTime sY'-'sM'-'sD' 'sH':'sMi':'sS
     778    parse var NowTime nY'-'nM'-'nD' 'nH':'nMi':'nS
     779
     780    if nY//4 = 0 & nY//400 <> 0 then doM.2 = 29
     781
     782    uY =nY-sY
     783    uM =nM-sM
     784    uD =nD-sD
     785    uH =nH-sH
     786    uMi=nMi-sMi
     787    uS =nS-sS
     788
     789    if uS < 0 then do; uMi= uMi- 1; uS = uS + 60; end
     790    if uMi< 0 then do; uH = uH - 1; uMi= uMi+ 60; end
     791    if uH < 0 then do; uD = uD - 1; uH = uH + 24; end
     792    if uD < 0 then do;
     793        /* uM = uM - 1; */
     794        if uM < 0 then uMx = uM + 12; else uMx = uM
     795        uD = uD + doM.uMx - 1;
     796    end
     797    if uM < 0 then do; uY = uY - 1; uM = uM + 12; end
     798
     799    if options.!debug == 1 then say '  uptime is 'uY uM uD uH uMi uS
     800
     801    UpTimeStr = ' 'NlvGetMessage(43)':'
     802    if uY <> 0 then UpTimeStr = UpTimeStr' 'uY' 'NlvGetMessage(44)
     803    if uM <> 0 then UpTimeStr = UpTimeStr' 'uM' 'NlvGetMessage(45)
     804    if uD <> 0 then UpTimeStr = UpTimeStr' 'uD' 'NlvGetMessage(46)
     805    if uH <> 0 then UpTimeStr = UpTimeStr' 'uH' 'NlvGetMessage(47)
     806    if uMi<> 0 then UpTimeStr = UpTimeStr' 'uMi' 'NlvGetMessage(48)
     807    if uS <> 0 | UpTimeStr = ' 'NlvGetMessage(43)':' then UpTimeStr = UpTimeStr' 'uS' 'NlvGetMessage(49)
     808
     809    ok = VRset("CN_Daemons", "Caption", UpTimeStr)
     810    if options.!debug == 1 then say time()' _SambaUptime() done'
     811return
     812
     813/*:VRX         _ShowMsg
     814*/
     815_ShowMsg:
     816    Buttons.1 = NLVGetMessage(2)
     817    Buttons.0 = 1
     818    id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 )
     819return
     820
    351821/*:VRX         CB_Debug_Click
    352822*/
     
    382852    window = VRWindow()
    383853    call VRMethod window, "CenterWindow"
    384     call VRSet window, "Visible", 1
     854    call VRSet window, "Visible", 0
    385855    call VRMethod window, "Activate"
    386856    drop window
     
    406876    call _GUIInit
    407877
     878    call VRSet "Main", "Visible", 1
    408879    ok = VRMethod("PB_Refresh","SetFocus")
     880    call PB_Refresh_Click
    409881return
    410882
     
    474946    end
    475947
     948    /* check and empty event queue, trash spurious resize events */
     949    EventString = ''
     950    TrashedResize = 0
     951    do until EventString = 'nop'
     952        EventString = VREvent('N')
     953        if EventString <> 'nop' then do
     954            if EventString = 'CALL 'MainWin'_Resize' then TrashedResize = 1
     955                                                    else interpret eventString
     956        end
     957    end
     958
    476959    ok = VRSet("Main","Painting", 1)
    477960return
     
    481964PB_Cancel_Click:
    482965    call Quit
     966return
     967
     968/*:VRX         PB_Refresh_Click
     969*/
     970PB_Refresh_Click:
     971    call _Refresh
     972    call _RefreshTree
    483973return
    484974
     
    6911181return
    6921182
     1183/*:VRX         TDL_1_PageSelected
     1184*/
     1185TDL_1_PageSelected:
     1186    say VRInfo("OldPage")
     1187    say VRInfo("OldPageWindow")
     1188    say VRInfo("Page")
     1189return
     1190
     1191/*:VRX         TM_Refresh_Trigger
     1192*/
     1193TM_Refresh_Trigger:
     1194    call PB_Refresh_Click
     1195return
     1196
     1197/*:VRX         TM_RefreshTreeDisplay_Trigger
     1198*/
     1199TM_RefreshTreeDisplay_Trigger:
     1200    select
     1201        when RefreshMode = "TREE" then do
     1202            call _RefreshTreeDisplay
     1203        end
     1204        when RefreshMode = "SHARE" then do
     1205            call _AddSharesDisplay   
     1206        end
     1207        otherwise say "RefreshMode = "RefreshMode
     1208    end
     1209return
     1210
Note: See TracChangeset for help on using the changeset viewer.