Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 8

ApOpenDBaseFile()

Open an external module file as a widget database

Synopsis:

#include <Ap.h>

ApDBase_t *ApOpenDBaseFile( char const *path );

Arguments:

path
The path of the external module file that you want to open.

Library:

Ap

Description:

ApOpenDBaseFile() opens an external module file as a widget database. Typically, the module is a picture, but it can also be a window or dialog. External module files supported have a .wgtp, .wgti, .wgtd, or .wgtw extension.

ApOpenDBase() opens the module specified by a ABM_ internal link manifest that's generated by PhAB.


Note: Before calling ApOpenDBaseFile(), you should call ApAddClass() for each widget class that you'll likely encounter in the database. This function adds the widget classes to the internal widget class table.

Note that this function associates the widget database with the current PhAB context. Only language translations from that context are applied when you create widgets using the database. If you don't want any language translations to be applied to an external database, set the current context to NULL when you open the database:

ApSetContext( NULL );
ApDBase_t *db = ApOpenDBaseFile( fname );
ApSetContext( & AbContext ); // Restore the program's
                                 // context

A typical PhAB application has only one PhAB context; only applications that load PhAB-created DLLs have to deal with multiple contexts. For more information about creating DLLs from PhAB applications, see “Making a DLL out of a PhAB application” in the Generating, Compiling, and Running Code chapter of the Photon Programmer's Guide.

Returns:

A pointer to a PhAB picture database structure, or NULL for failure.

Examples:

ApDBase_t        *mydbase;
PtArg_t          args[2];

/* Add the widget classes that are in the database
   to the internal table. */

ApAddClass ("PtLabel", &PtLabel);

mydbase = ApOpenDBaseFile( "mypicture.wgtp" );

PtSetArg( &args[0], Pt_ARG_TEXT_STRING,
          "This Widget", 0 );
ApCreateWidget( mydbase, "my_label_widget", 10, 10, 1,
                args );

PtSetArg( &args[0], Pt_ARG_TEXT_STRING,
          "That Widget", 0 );
PtSetArg( &args[1], Pt_ARG_FILL_COLOR, Pg_WHITE, 0 );
ApCreateWidget( mydbase, "my_label_widget", 10, 30, 2,
                args );

ApCloseDBase( mydbase );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApAddClass(), ApCreateDBWidget(), ApCreateDBWidgetFamily(), ApCreateWidget(), ApCreateWidgetFamily(), ApGetDBWidgetInfo(), ApCloseDBase(), ApOpenDBase()

Accessing PhAB Modules from Code chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 179

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/ap/apopendbasefile.html on line 179