diff --git a/programs/media/Fplay/winlib/main.c b/programs/media/Fplay/winlib/main.c new file mode 100644 index 0000000000..c4ddaba1cf --- /dev/null +++ b/programs/media/Fplay/winlib/main.c @@ -0,0 +1,78 @@ + +#include "system.h" +#include +#include + +#include "winlib.h" + + +//#define ID_APPLY 1 +//#define ID_CANCEL 2 + + +int MainWindowProc(ctrl_t *ctrl, uint32_t msg, uint32_t arg1, uint32_t arg2) +{ + window_t *win; + + win = (window_t*)ctrl; + + switch(msg) + { +// case MSG_SIZE: +// break; + + case MSG_COMMAND: + switch((short)arg1) + { +// case ID_APPLY: + // if(lbx->itemSelect!=-1) + // { + // mode = (mode_t*)lbx->items[lbx->itemSelect].attr; + // printf("%d x %d %d Hz\n\r",mode->width,mode->height,mode->freq); + // set_mode(mode); + // }; + // break; + case ID_CLOSE: + exit(0); + }; + break; + + default: + def_window_proc(ctrl,msg,arg1,arg2); + }; + return 0; +} + +int main(int argc, char* argv[], char *envp[]) +{ + window_t *MainWindow; + button_t *btn; +// int result; + + init_winlib(); + + rect_t *rc; + + MainWindow = create_window(0,0,200,200,480,340,MainWindowProc); + +// rc = &MainWindow->client; + +// btn = create_button(NULL, ID_CLOSE,20,57,17,17,(ctrl_t*)MainWindow); +// fr->close_btn = btn; + +// vscroll = create_scroller(0, 1, rc->r -24, rc->t, 24, rc->b - rc->t, +// (ctrl_t*)MainFrame); + +// btn = create_button("Apply",ID_APPLY,300,50,80,28,(ctrl_t*)MainFrame); +// if( !btn ) +// return 0; + +// btn = create_button("Cancel",ID_CANCEL,300,90,80,28,(ctrl_t*)MainFrame); +// if( !btn ) +// return 0; + + show_window(MainWindow, NORMAL); + run_window(MainWindow); + + return 0; +}; diff --git a/programs/media/Fplay/winlib/window.c b/programs/media/Fplay/winlib/window.c index 0bcc78ea78..04ca66db88 100644 --- a/programs/media/Fplay/winlib/window.c +++ b/programs/media/Fplay/winlib/window.c @@ -254,9 +254,9 @@ void window_update_layout(window_t *win) }; if(state & 1) - win->win_state = MAXIMIZED; + state = MAXIMIZED; else - win->win_state = NORMAL; + state = NORMAL; if( (winx != win->rc.l) || (winy != win->rc.t) ) { @@ -267,9 +267,13 @@ void window_update_layout(window_t *win) }; if( winw == win->w && - winh == win->h) + winh == win->h && + state == win->win_state) + return; + win->win_state = state; + #if 0 int old_size; int new_size; diff --git a/programs/media/Fplay/winlib/winlib.h b/programs/media/Fplay/winlib/winlib.h index c74efb555a..60e0a0eba3 100644 --- a/programs/media/Fplay/winlib/winlib.h +++ b/programs/media/Fplay/winlib/winlib.h @@ -75,8 +75,8 @@ typedef struct rect_t client; - ctx_t client_ctx; - bitmap_t bitmap; +// ctx_t client_ctx; +// bitmap_t bitmap; char *caption_txt; ctrl_t *child_over;