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 ); }
SaneWinMain( argc, argv ) { PSI_CONTROL frame; PSI_CONTROL clock; if( argc > 1 ) frame = NULL; else frame = CreateFrame( WIDE("blah"), 0, 0, 500, 500, BORDER_RESIZABLE|BORDER_NORMAL, NULL ); clock = MakeNamedControl( frame, WIDE("Basic Clock Widget"), 0, 0, 350, 350, -1 ); if( frame ) SetControlText( frame, WIDE("CLock Test Widet") ); SetControlText( clock, WIDE("CLock Test Widet") ); if( !frame ) SetCommonBorder( clock,BORDER_RESIZABLE|BORDER_NORMAL ); DisplayFrame( frame?frame:clock ); MakeClockAnalog( clock ); while( 1 ) WakeableSleep( 1000 ); }
} void CPROC tickthing( uintptr_t psv ) { PSI_CONTROL pc = (PSI_CONTROL)psv; //pcprintf( pc, WIDE("blah\n") ); } static uintptr_t OnCreateControl( WIDE("Dekware Console") )( PSI_CONTROL parent, int32_t x, int32_t y, uint32_t w, uint32_t h ) { PSI_CONTROL pc; pc = MakeNamedControl( parent, WIDE("Dekware PSI Console"), x, y, w, h, -1 ); AddTimer( 250, tickthing, (uintptr_t)pc ); return (uintptr_t)pc; } static PSI_CONTROL OnGetControl( WIDE("Dekware Console") )( uintptr_t psv ) { return (PSI_CONTROL)psv; } PUBLIC( void, ExportedSymbolToMakeWatcomHappy )( void ) { }