@DATABASE App V1.00
$VER: PureBasic - App library V1.00 (01.09.1999) © Fantaisie Software
@NODE MAIN "App V1.00"

  @{b}PureBasic - App library V1.00@{ub}

    'App' is a word which design a set of tool to enhance the AmigaOS
    via some useful functions based on the Drag'n'Drop. This library
    support the window and the menu app range of functions. With these,
    you could add the 'Drag some icons on my window and I can
    tell you which are they' feature a cool item n the 'Tools' menu
    entry of the Workbench screen.

  @{b}Commands summary in alphabetical order:@{ub}

    @{" AddAppWindow      " LINK AddAppWindow}
    @{" AddAppMenu        " LINK AddAppMenu}
    @{" AppEvent          " LINK AppEvent}
    @{" AppNumFiles       " LINK AppNumFiles}
    @{" InitApp           " LINK InitApp}
    @{" NextAppFile       " LINK NextAppFile}
    @{" RemoveAppMenu     " LINK RemoveAppMenu}
    @{" RemoveAppWindow   " LINK RemoveAppWindow}

  @{b}Example:@{ub}

    @{" App window & menu " LINK "PureBasic:Examples/Sources/App.pb/Main"}

@ENDNODE


@NODE AddAppWindow

    @{b}SYNTAX@{ub}
  Result.b = AddAppWindow(#AppID, WindowID())

    @{b}COMMAND@{ub}
  Tries to convert the window into an AppWindow. The #AppID number
  is the app identifiant which will be returned by AppEvent()
  when an event occurs in this window. You can get the WindowID with
  the WindowID() function of the window library.

@ENDNODE


@NODE AddAppMenu

    @{b}SYNTAX@{ub}
  Result.b = AddAppMenu(#AppID, &Title$)

    @{b}COMMAND@{ub}
  Tries to add a menu entry in the workbench menu 'Tools'. The #AppID
  number is the app identifiant which will be returned by AppEvent()
  if this 'menu entry' is chosen by the user. Title$ must be a variable
  that you have declared before you call this function and you must not
  modify it during the menu's lifetime.

  Example:

    AppMenuTitle$ = "Hehe, I'm an App menu"
    AddAppMenu(1, &AppMenuTitle$)

@ENDNODE


@NODE AppEvent

    @{b}SYNTAX@{ub}
  Event.l = AppEvent

    @{b}FUNCTION@{ub}
  It will return the #AppID number of a menu or window event if an
  event has occurred since the last call to this function.

@ENDNODE


@NODE AppNumFiles

    @{b}SYNTAX@{ub}
  NumFiles.l = AppNumFiles

    @{b}FUNCTION@{ub}
  This will return the number of icons dropped on the window and allow
  the programmer to do a little loop to read all the filenames. This
  function is used in conjunction with NextAppFile.

@ENDNODE


@NODE InitApp

    @{b}SYNTAX@{ub}
  result.l = InitApp

    @{b}FUNCTION@{ub}
  Will attempt to open the workbench.library V36+. If result is NULL, it
  can't be opened, so test it carefully at the top of your program to
  prevent a future crash. You need to use this function if you want to use
  the App commands.

  Example:

  If InitApp(10) = 0
    NPrint("Can't open the workbench.library V36+")
    End                                      ; Quit the program or disable
                                             ; your App calls.
  EndIf

@ENDNODE


@NODE NextAppFile

    @{b}SYNTAX@{ub}
  File$ = NextAppFile

    @{b}FUNCTION@{ub}
  This function returns the full filepath and filename (correctly-
  concatenated) of the next (or first if it's the first call) icon
  dropped on the AppWindow.

@ENDNODE


@NODE RemoveAppMenu

    @{b}SYNTAX@{ub}
  RemoveAppMenu #AppID

    @{b}STATEMENT@{ub}
  Removes the specified menu entry of the workench/Tools menu.

@ENDNODE


@NODE RemoveAppWindow

    @{b}SYNTAX@{ub}
  RemoveAppWindow #AppID

    @{b}STATEMENT@{ub}
  Remove the App facility of the specified AppWindow.

@ENDNODE
