*** rasmol.c 2004/05/07 19:46:16 1.1 --- rasmol.c 2004/10/30 20:41:17 *************** *** 184,189 **** --- 184,193 ---- #include #endif + #ifdef XFORMSLIB + #include + #endif + #define IsIdentChar(x) ((isalnum(x))||((x)=='_')||((x)=='$')) #define TwoPi 2.0*PI *************** *** 817,822 **** --- 821,843 ---- LoadScriptFile(initrc,fname); } + #ifdef XFORMSLIB + static void HandleFileOpen( void ) + { + char *r; + + r = fl_show_fselector("Open Structure file", "", "", ""); + + if (r && *r) { + WriteString("load "); + WriteString(r); + WriteChar(' '); + if ( FetchFile(FormatPDB,False,r) ) + DefaultRepresentation(); + ResetCommandLine(0); + } + } + #endif static void HandleMenu( int hand ) { *************** *** 831,837 **** --- 852,862 ---- switch( item ) { case(1): /* Open */ if( NumMolecules < MAX_MOLECULES ) + #ifdef XFORMSLIB + HandleFileOpen(); + #else ResetCommandLine(2); + #endif break; case(2): /* Save As */ *************** *** 1498,1503 **** --- 1523,1539 ---- } else WriteString("Display window disabled!\n"); } + #ifdef XFORMSLIB + if ( Interactive ) { + FD_FSELECTOR *fs; + fl_initialize(&argc, argv, VersionStr, 0, 0); + fl_set_fselector_fontsize(14); + fs = fl_get_fselector_fdstruct(); + fl_set_object_label(fs->ready, "Load"); + fl_fit_object_label(fs->ready, 1, 1); + } + #endif + InitialiseCmndLine(); InitialiseCommand(); InitialiseTransform();