Mercurial > dwindows
comparison gtk/dw.c @ 15:81833f25b1aa
Added new Dynamic Windows build information to the DWEnv struct.
It reports version numbers and build time/date.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 12 Jul 2001 20:31:26 +0000 |
parents | 176cee043f1b |
children | f26eced21a30 |
comparison
equal
deleted
inserted
replaced
14:176cee043f1b | 15:81833f25b1aa |
---|---|
3387 int _locked_by_me = FALSE; | 3387 int _locked_by_me = FALSE; |
3388 | 3388 |
3389 DW_MUTEX_LOCK; | 3389 DW_MUTEX_LOCK; |
3390 if(handle && GTK_IS_WINDOW(handle)) | 3390 if(handle && GTK_IS_WINDOW(handle)) |
3391 { | 3391 { |
3392 GdkWindow *parent = gdk_window_get_parent(handle->window); | |
3393 int cx = (int)gtk_object_get_data(GTK_OBJECT(handle), "cx"); | 3392 int cx = (int)gtk_object_get_data(GTK_OBJECT(handle), "cx"); |
3394 int cy = (int)gtk_object_get_data(GTK_OBJECT(handle), "cy"); | 3393 int cy = (int)gtk_object_get_data(GTK_OBJECT(handle), "cy"); |
3395 | 3394 |
3396 _size_allocate(GTK_WINDOW(handle)); | 3395 _size_allocate(GTK_WINDOW(handle)); |
3397 #if 0 | 3396 |
3398 if(parent) | 3397 gtk_widget_set_uposition(handle, x, y); |
3399 { | 3398 gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy); |
3400 gdk_window_resize(parent, width, height); | |
3401 gdk_window_move(parent, x, y); | |
3402 } | |
3403 else | |
3404 #endif | |
3405 { | |
3406 gtk_widget_set_uposition(handle, x, y); | |
3407 gtk_window_set_default_size(GTK_WINDOW(handle), width - cx, height - cy); | |
3408 } | |
3409 } | 3399 } |
3410 else if(handle && handle->window) | 3400 else if(handle && handle->window) |
3411 { | 3401 { |
3412 gdk_window_resize(handle->window, width, height); | 3402 gdk_window_resize(handle->window, width, height); |
3413 gdk_window_move(handle->window, x, y); | 3403 gdk_window_move(handle->window, x, y); |
3493 int z; | 3483 int z; |
3494 int _locked_by_me = FALSE; | 3484 int _locked_by_me = FALSE; |
3495 | 3485 |
3496 DW_MUTEX_LOCK; | 3486 DW_MUTEX_LOCK; |
3497 for(z=0;z<256;z++) | 3487 for(z=0;z<256;z++) |
3488 { | |
3498 if(!gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z)) | 3489 if(!gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), z)) |
3499 { | 3490 { |
3500 DW_MUTEX_UNLOCK; | 3491 DW_MUTEX_UNLOCK; |
3501 return z; | 3492 return z; |
3502 } | 3493 } |
3494 } | |
3503 | 3495 |
3504 DW_MUTEX_UNLOCK; | 3496 DW_MUTEX_UNLOCK; |
3505 | 3497 |
3506 /* Hopefully this won't happen. */ | 3498 /* Hopefully this won't happen. */ |
3507 return 256; | 3499 return 256; |
3592 * pageid: Page ID in the notebook which is being packed. | 3584 * pageid: Page ID in the notebook which is being packed. |
3593 * page: Box handle to be packed. | 3585 * page: Box handle to be packed. |
3594 */ | 3586 */ |
3595 void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page) | 3587 void dw_notebook_pack(HWND handle, unsigned long pageid, HWND page) |
3596 { | 3588 { |
3597 GtkWidget *label; | 3589 GtkWidget *label, *child, *oldlabel; |
3598 int _locked_by_me = FALSE; | 3590 gchar *text = NULL; |
3599 | 3591 int _locked_by_me = FALSE; |
3600 DW_MUTEX_LOCK; | 3592 |
3601 label = gtk_label_new(""); | 3593 DW_MUTEX_LOCK; |
3602 | 3594 child = gtk_notebook_get_nth_page(GTK_NOTEBOOK(handle), pageid); |
3603 gtk_notebook_append_page (GTK_NOTEBOOK(handle), page, label); | 3595 if(child) |
3596 { | |
3597 oldlabel = gtk_notebook_get_tab_label(GTK_NOTEBOOK(handle), child); | |
3598 if(oldlabel) | |
3599 gtk_label_get(GTK_LABEL(oldlabel), &text); | |
3600 } | |
3601 | |
3602 label = gtk_label_new(text ? text : ""); | |
3603 | |
3604 gtk_notebook_insert_page(GTK_NOTEBOOK(handle), page, label, pageid); | |
3605 if(child) | |
3606 gtk_notebook_remove_page(GTK_NOTEBOOK(handle), pageid+1); | |
3604 DW_MUTEX_UNLOCK; | 3607 DW_MUTEX_UNLOCK; |
3605 } | 3608 } |
3606 | 3609 |
3607 /* | 3610 /* |
3608 * Appends the specified text to the listbox's (or combobox) entry list. | 3611 * Appends the specified text to the listbox's (or combobox) entry list. |
4102 strcpy(tempbuf, name.release); | 4105 strcpy(tempbuf, name.release); |
4103 | 4106 |
4104 env->MajorBuild = env->MinorBuild = 0; | 4107 env->MajorBuild = env->MinorBuild = 0; |
4105 | 4108 |
4106 len = strlen(tempbuf); | 4109 len = strlen(tempbuf); |
4110 | |
4111 strcpy(env->buildDate, __DATE__); | |
4112 strcpy(env->buildTime, __TIME__); | |
4113 env->DWMajorVersion = DW_MAJOR_VERSION; | |
4114 env->DWMinorVersion = DW_MINOR_VERSION; | |
4115 env->DWSubVersion = DW_SUB_VERSION; | |
4107 | 4116 |
4108 for(z=1;z<len;z++) | 4117 for(z=1;z<len;z++) |
4109 { | 4118 { |
4110 if(tempbuf[z] == '.') | 4119 if(tempbuf[z] == '.') |
4111 { | 4120 { |