int main( void ) { PSI_CONTROL frame = CreateFrame( WIDE("test scrolling texts"), 0, 0, 1024, 768, 0, NULL ); if( frame ) { t1 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 5, 300, 15, -1, WIDE("Scroll This Text...") ); t2 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 25, 300, 15, -1, WIDE("Scroll This Text...") ); t3 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 45, 300, 15, -1, WIDE("Scroll This Text...") ); SetControlAlignment( t3, TEXT_CENTER ); t4 = MakeNamedCaptionedControl( frame, STATIC_TEXT_NAME, 5, 65, 300, 15, -1, WIDE("Scroll This Text...") ); SetControlAlignment( t4, TEXT_CENTER ); DisplayFrame( frame ); AddTimer( 50, DoScroll, 0 ); CommonWait( frame ); } }
void ShowMediaPanel( struct my_button *media ) { INDEX idx; struct media_control_panel *panel; LIST_FORALL( l.controls, idx, struct media_control_panel *, panel ) { if( panel->media == media ) break; } if( !panel ) { PSI_CONTROL newPanel = MakeNamedControl( NULL, MyName, 0, 0, 500, 75, -1 ); MyValidatedControlData(struct media_control_panel*, new_panel, newPanel ); panel = new_panel; panel->media = media; panel->flags.playing = 1; // is playing, otherwise media panel wouldn't be showing... panel->knob = MakeNamedControl( newPanel, CONTROL_SCROLL_KNOB_NAME, 0, 0, 50, 50, -1 ); panel->knob_image = LoadImageFile( WIDE( "images/dial2a.png" ) ); SetScrollKnobImage( panel->knob, panel->knob_image ); SetScrollKnobEvent( panel->knob, KnobTick, (uintptr_t)panel ); panel->stop_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 0, 50, 25, -1, "Stop" ); SetButtonPushMethod( panel->stop_button, stop_pushed, (uintptr_t)panel ); #ifdef _DEBUG panel->debug_mem_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 100, 55, 100, 25, -1, "Debug Memory" ); SetButtonPushMethod( panel->debug_mem_button, debug_mem, (uintptr_t)panel ); #endif panel->pause_button = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 25, 50, 25, -1, "Pause" ); SetButtonPushMethod( panel->pause_button, pause_pushed, (uintptr_t)panel ); panel->progress = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 50, 50, 25, -1, "???" ); //panel->progress = MakeNamedCaptionedControl( newPanel, WIDE( "Button" ), 50, 75, 50, 25, -1, "???" ); panel->seek_slider = MakeNamedControl( newPanel, SLIDER_CONTROL_NAME,100, 0, 400, 50, -1 ); SetSliderOptions( panel->seek_slider, SLIDER_HORIZ ); SetSliderValues( panel->seek_slider, 0, 0, 10000 ); // 100.00% SetSliderUpdateHandler( panel->seek_slider, seek_changed, (uintptr_t)panel ); DisplayFrame( newPanel ); } else { // have an existing panel to just show. RevealCommon( panel->panel ); } ffmpeg_SetPositionUpdateCallback( panel->media->file, video_position_update, (uintptr_t)panel ); }
int main( void ) #endif { PSI_CONTROL frame = CreateFrame( "Test Some Controls", 0, 0, 0, 0, BORDER_RESIZABLE, NULL ); DisplayFrame( frame ); { int n = 0; PSI_CONTROL controls[10][10]; int x, y; for( x = 0; x < 10; x++ ) for( y = 0; y < 10; y++ ) { controls[x][y] = MakeNamedCaptionedControl( frame, "Button", x*15 + 5, y*15+5, 15, 15, -1, "B" ); //SmudgeCommon( controls[x][y] ); } Sleep( 5000 ); //DisplayFrame( frame ); //Relinquish(); //WakeableSleep( 10000 ); do { n++; for( x = 0; x < 10; x++ ) for( y = 0; y < 10; y++ ) HideCommon( controls[x][y] ); Sleep( 200 ); for( x = 0; x < 10; x++ ) for( y = 0; y < 10; y++ ) RevealCommon( controls[x][y] ); Sleep( 200 ); } while( 100 > n ); } DestroyFrame( &frame ); return 0; }