Subversion Repositories Kolibri OS

Rev

Rev 9620 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9620 Rev 9766
1
#include 
-
 
2
#include 
1
#include 
3
#include 
2
#include 
-
 
3
#include 
4
 
4
 
5
int main()
5
int main()
6
{
6
{
7
    open_dialog *dlg_open = kolibri_new_open_dialog(OPEN, 10, 10, 420, 320); // create opendialog struct
7
    open_dialog* dlg_open = kolibri_new_open_dialog(OPEN, 10, 10, 420, 320); // create opendialog struct
8
    OpenDialog_init(dlg_open); // Initializing an open dialog box. 
8
    OpenDialog_init(dlg_open);                                               // Initializing an open dialog box.
9
    OpenDialog_start(dlg_open); // Show open dialog box
9
    OpenDialog_start(dlg_open);                                              // Show open dialog box
10
    
10
 
11
    color_dialog *color_select = kolibri_new_color_dialog(SELECT, 10, 10,420,320); // create colordialog struct
11
    color_dialog* color_select = kolibri_new_color_dialog(SELECT, 10, 10, 420, 320); // create colordialog struct
12
    ColorDialog_init(color_select); // Initializing an color dialog box. 
12
    ColorDialog_init(color_select);                                                  // Initializing an color dialog box.
13
    ColorDialog_start(color_select); // Show color dialog
13
    ColorDialog_start(color_select);                                                 // Show color dialog
14
    
14
 
15
    if(dlg_open->status == SUCCESS){
15
    if (dlg_open->status == SUCCESS) {
16
        printf("File selected '%s'\n",dlg_open->openfile_path);
16
        printf("File selected '%s'\n", dlg_open->openfile_path);
17
    }else{
17
    } else {
18
        puts("No file selected!");
18
        puts("No file selected!");
19
    }
19
    }
20
    
20
 
21
    if(color_select->status == SUCCESS){
21
    if (color_select->status == SUCCESS) {
22
        printf("Color selected: #%06X\n",color_select->color);
22
        printf("Color selected: #%06X\n", color_select->color);
23
        rgb_t color_rgb = (rgb_t)color_select->color;
23
        rgb_t color_rgb = (rgb_t)color_select->color;
24
        printf("Red:%d Green:%d Blue:%d", color_rgb.red, color_rgb.green, color_rgb.blue); 
24
        printf("Red:%d Green:%d Blue:%d", color_rgb.red, color_rgb.green, color_rgb.blue);
25
    }else{
25
    } else {
26
        puts("No color selected!");
26
        puts("No color selected!");
27
    }
27
    }
28
    free(dlg_open);
28
    free(dlg_open);
29
    free(color_select);
29
    free(color_select);
30
    return 0;
30
    return 0;
31
}
31
}