Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
File Manager (ReBuild) simple POC
#1
Hallo,

hier ein kleines ShowCase eines DOpus-Clones, den ich schon vor Jahren "fertig" hatte, der es aber nie zum Release schaffte.
Ich habe vor ein paar Jahren dann die GUI neu gebaut, bzw. ein eigenes, reduziertes GadTools Toolkit implementiert, das die aktuelle Version stützt.

Ich schreibe da immer mal wieder dran rum. Aktuell versuche ich, die ganzen DOS-Sachen, die noch als Include-Code aus dem alten Projekt drinhängen, global mit den anderen DOS-Tools abzugleichen.

Den "SetErr inside Function" - Fehler kann man ja leider in BlitzBasic2 nicht umgehen, darum ist das Hauptprogramm leider noch immer so lang:
Code:
.

;#########################################################################
.gui_init

fontsetup{}        ;set up fonts for lists, buttons etc.

ClrErr: !stderror { eerror {"Couldn`t load Font(s)"}:End}  ;easyerror no reqtools lock

loadguifonts{}     ;load required fonts...

ClrErr: !stderror          ;End
ClrErr: !stderror { eerror {"Couldn`t open Screen"}:End}

res.l=setmscreen{}    ;open up screen (or catch public one)...

ClrErr: !stderror

If res

   ClrErr: !stderror { eerror {"Couldn`t open Window"}:End}

   *mywin.Window=setmwindow{} ;open up main window

   ClrErr: !stderror

   If *mywin>0

     Use Window #listerwin   ;
     CatchDosErrs            ;needed for reqtools!!

     *rp.RastPort=*mywin\RPort

     If *rp>0

       setdefcolprefs{}

       mnp\ndevs=filldevlist{}            ; fill device list

       redo_window{mnp\layoutmode}        ; redraw window contens

       mnp\ende=0
       Gosub main        ;jump to mainloop...

     EndIf
   EndIf

EndIf

FlushEvents

Free IntuiFont (screenfnt\buttons\fid)
Free IntuiFont (screenfnt\listbox\fid)
CloseWindow #listerwin:CloseScreen1
End
NoCli:CloseEd:WBStartup
;#########################################################################

.main
Repeat
lev\ev =WaitEvent
lev\evc=EventCode

get_mcoords{}   ;get mouses screen+win coords (and save them)

lev\mbt=MButtons

If lev\smy=>mnp\badd Then MenusOff Else MenusOn

Select lev\ev

   Case$2    ;resize win
     ; lev\sord=#NBOX                ;deselect
     redo_window{mnp\layoutmode}   ;(detach gads, redraw, re-attach gads)

   Case$400  :  dokeyhits {UCase$(Inkey$)}

   Case$8    :  handleclicks {}  ;mclicks

   Case$40   :  lev\gadh=GadgetHit : do_strgad {lev\gadh} ;path string gad?

   Case$20   :  lev\gadh=GadgetHit : doscrollgads{}

   Case$10
     get_mcoords{}
     statustext{mover$(lev\mover)} ;DEBUGG!

     CNIF#debugg=1
       dbgtitle {" ESC for QUIT "+"["+Str$(lev\wmx)+" x "+Str$(lev\wmy)+"] "+Str$(getmline{lev\sord,lev\wmx,lev\wmy})} ;1+ remov
     CEND
   ;Case activatewin/deactivatewin/movewin
End Select
Until mnp\ende
Return

;
._eof
;
Der eigentliche Gesamtcode umfaßt 4200+ Zeilen; davon ist eigentlich alles als Include auslagerbar bzw. schon ausgelagert.

Die History ist bei mir (bei größeren Projekten) am Anfang und Teil eines eigenen 'Revisions-Header's:
Code:
;################################################################################
;#                                                                              #
;#  History    :                                                                #
;#               24.03.2004                                                     #
;#               19.12.2008
;#               09.01.2009
;#               19.07.2009
;#               17.08.2009
;#               23.10.2009
;#               21.12.2009
;#               30.12.2009
;#               01.01.2010
;#               02.01.2010
;#               03.01.2010
;#               05.01.2010
;#               06.01.2010
;#                      ADD `switchlister{lboxnr}` to select lister
;#                      CHG `togglelister{}` to use `switchlister{}`
;#                      CHG `main` to use `switchllister{}` in mbut events
;#               12.01.2010
;#                      CHG `moverect{}` to return also selboxes (#SEBL,#SEBR)
;#                      CHG `dostrgad{}` path stringgad readdir to
;#                          use `pathadd{}` (and `pathdef{}`)
;#               13.01.2010
;#                      CHG use `extractpath_03.fun.bb` for path string handling
;#                      CHG fixd bug: readlist of unselected lister
;#                          caused empty \vol of `inh_{}` of other lister
;#               31.03.2010
;#                      CHG Bug in `filldevlist{}`: dtype.b -> dtype.l
;#               08.04.2010
;#                      CHG 'expath{}' to use #exa_file etc constants (extractpath_03.fun.bb incl)
;#                      ADD 'eerror{}' easyerror for errs not using Reqtools
;#               09.04.2010
;#                      ADD dblclick use for dirs (browse to), files
;#                      CHG #lb_ const to avoid 0 (unused from now)
;#               14.04.2010
;#                      CHG entering path to string now adds that also to lbox()\lbc\path
;#               19.04.2010
;#               20.04.2010
;#                      CHG 'dragmouse{}' to use \mover
;#                      CHG 'mark_yscroll{}' to avoid dbl prtlin calls (moved enclosing EndIf)
;#               21.04.2010
;#                      ADD check for string in 'statustext{}'
;#                      ADD #maxbrows max button rows, for buttons on/off use
;#                      ADD #STAT return from mover{}
;#                      CHG #lb_ constants for \sbyte, leading bytes
;#                          -> chg this later to bits for \art
;#               28.04.2010
;#               29.04.2010
;#                      CHG mouseclick handling to subs, later funcs
;#                      CHG handleclicks (lmbdown, lmbup) to funcs
;#               30.04.2010
;#                      CHG gui_init to func: not possible: seterr inside func error
;#                      ADD select/deselect entries via keyb A, N: `selectall{}`
;#               04.05.2010
;#                      CHG replace calls to obsolete `switchlister{}` with `selectlister{}`
;#                      CHG listbox.ntype \fw, \fh to \tw, \th
;#                      ADD crect ntype for char algnd lister dims
;#               05.05.2010
;#                      CHG `placebutton{}` to use `drawbutton{}` if #dogads=0
;#                      CHG del `drawbuttons{}`: obsolete
;#                      CHG `selectall{}` to use tog for invert select too (-1)
;#                      CHG devlist button drawing/mclick to support refresh of each button
;#                      CHG devlist clk now hilights the clkd devbutton (invert)
;#                          -> also chg some getdevnum etc. return vals etc.
;#               06.05.2010
;#                      CHG some setlspeed{} (optims)
;#                      FIX filldevlist -1 of found devs
;#                      ADD const for scroller areas for mouse over
;#               07.05.2010
;#                      CHG getmline{} to use lev\mover (optim that later)
;#               08.05.2010
;#                      CHG dodevlist{} to use drawdevbutton{} for border draw
;#                      CHG clk handling on device list to use drawdevbutton{}
;#                          -> clkd device button now reverts border instead of contens
;#                      CHG inh{}, some optims
;#                      CHG buildformstr{} value to .float
;#                      CHG buildformstr{} to avoid Str$() by using value
;#               22.05.2010
;#                      CHG inh{}: now counting 'Objects', not 'Files'
;#                      ADD chg.b flag to lentry: entry changd (e.g. dir not scanned)
;#               23.05.2010
;#                      CHG creation of \display of entry now done by 'set_entrydispl{}'
;#                      ADD 'getdriveinfo{}' to get drives numblocks etc. (was part of dir{})
;#                      ADD protbits to list display
;#                      ADD comment string to list entry
;#               25.05.2010
;#                      ADD support for p96-screenmodes for #ownscreen use
;#
;#               28.05.2010
;#                      CHG fixd bug in 'prtlrows{}': scrollprt of shorter lines
;#                          are wrong coloured prted (see there)
;#                      CHG date display:uses replace$() to sim locale
;#                      CHG 'setentrydisp{}' to more useful; date displ as above
;#               03.06.2010
;#                      CHG moved 'getdriveinfo{}' call from 'dir{}' to 'initreadl{}'
;#                      ADD 'upd_dirsizes{}' to scan selected dirs in list for size
;#                         -> does not yet update properly \display of llist entry
;#                      FIX 'setentrydispl{}' to accept EVERY entry of list (was \entries)
;#                      CHG moved upd of maxdispl len to 'setentrydispl{}'
;#               04.06.2010
;#                      ADD rtlockwindow for 'upd_dirsizes{}'
;#               06.06.2010
;#                      ADD parent dir read via P keystroke, used new 'stringparent{}'
;#                      ADD statustext display for updirsize scan
;#                      ADD \display of entry now indicates subdirs, by leading [+]
;#                      CHG fixed probs with ownscreen mode: fixd inlude
;#               24.06.2010
;#               09.07.2010
;#               23.07.2010
;#                      ADD #SEPB const for moverr{}
;#               24.07.2010
;#                      ADD live upd of lbox lines while getsizes of dir
;#                      CHG live update behavior
;#                      ADD `clrlbox{}` to clear text area of lbox
;#                      ADD `addtolist{}` for `dir{}` adding of llist entries
;#                      ADD `chgentry{}` to add more data to llist entries
;#               25.07.2010
;#                      CHG name of addtolist{} to setlistentry{}
;#               30.07.2010
;#               31.07.2010
;#                      CHG started use of #NBOX as overall lister area
;#                      CHG 'dolmbup{}'& #DEVS->#NBOX to show more infos using 'getdriveinfo{}'
;#                      CHG 'initreadl{}' to provide needed devinfo to #NBOX too
;#               06.10.2010
;#                      CHG _dolmb{} to wait for lmb leaved
;#               24.12.2010
;#               12.01.2011
;#               25.01.2014
;#               13.04.2014
;#                      CHG `moverect{}` to use dedicated func for "RectsHit"
;#                      ADD  more return values to `moverect{}`, e.g. Vscroller, Hscroller, Path
;#               30.11.2014
;#                      ADD path string l/r support to moverect{}
;#
;#################################################################################
Sehr alte Sachen in der History, die sowieso keine Rolle mehr spielen, werden gelöscht.
Amiga. Just to let ya know....
Zitieren


Nachrichten in diesem Thema

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste