RWK
Anmeldungsdatum: 04.07.2011 Beiträge: 44
|
Verfasst am: 15.12.2012, 21:03 Titel: IUP - GUI |
|
|
So denn...
Ich würde gerne mein GUI Zeugs auf IUP umstellen. Vielleicht hat sich der ein oder andere das schon angeschaut. Vielleicht liest ja auch der Joshy mit...
Ausser das mir na klar so ne schöne visuelle Entwicklung wie in FireFly abgeht, hab ich da mal ein Problem.
Ausgangsbasis ist das Button Beispiel. Hab ich mal ein paar Frames um die Controls gebaut.
Code: |
'
' main
'
var text = IupText( NULL )
IupSetAttribute( text, "EXPAND", "YES")
IupSetHandle ( "text", text )
var img_release = IupImage(16, 16, @pixmap_release(0))
IupSetAttribute( img_release, "1", "215 215 215" )
IupSetAttribute( img_release, "2", "40 40 40" )
IupSetAttribute( img_release, "3", "30 50 210" )
IupSetAttribute( img_release, "4", "240 0 0" )
IupSetHandle( "img_release", img_release )
var img_press = IupImage( 16, 16, @pixmap_press(0) )
IupSetAttribute( img_press, "1", "40 40 40" )
IupSetAttribute( img_press, "2", "215 215 215" )
IupSetAttribute( img_press, "3", "0 20 180" )
IupSetAttribute( img_press, "4", "210 0 0" )
IupSetHandle ( "img_press", img_press )
var img_inactive = IupImage( 16, 16, @pixmap_inactive(0) )
IupSetAttribute( img_inactive, "1", "215 215 215" )
IupSetAttribute( img_inactive, "2", "40 40 40" )
IupSetAttribute( img_inactive, "3", "100 100 100" )
IupSetAttribute( img_inactive, "4", "200 200 200" )
IupSetHandle ("img_inactive", img_inactive )
var btn_image = IupButton ( "Button with image", "btn_image")
IupSetAttribute( btn_image, "IMAGE" , "img_release" )
IupSetAttribute( btn_image, "IMPRESS" , "img_press" )
IupSetAttribute( btn_image, "IMINACTIVE", "img_inactive")
IupSetAttribute( btn_image, "BUTTON_CB" , "btn_image_button")
IupSetHandle( "btn_image", btn_image )
var btn_big = IupButton( "Big useless button", "" )
IupSetAttribute( btn_big, "SIZE", "EIGHTHxEIGHTH" )
var btn_exit = IupButton( "Exit", "btn_exit")
var btn_on_off = IupButton( "on/off", "btn_on_off")
var hbox =IupHbox( btn_image, btn_on_off, btn_exit, NULL )
IupSetAttribute(hbox, "GAP", "5")
var frm1 = iupframe(hbox)
var frm2 = iupframe(text)
var frm3 = iupframe(btn_big)
var vbox = IupVbox( frm1, frm2, frm3, NULL)
IupSetAttribute(vbox, "EXPANDCHILDREN", "YES")
IupSetAttribute(vbox, "GAP", "5")
var dlg = IupDialog( vbox)
IupSetAttributes( dlg, "EXPAND = YES, TITLE = IUP-TEST, RESIZE = YES" )
IupSetAttributes( dlg, "MENUBOX = YES, MAXBOX = NO, MINBOX = NO" )
IupSetAttributes ( dlg, "SIZE=HALFxHALF" )
IupSetAttribute(dlg, "MARGIN", "10x10")
IupSetCallback( btn_exit , "ACTION", cast(Icallback,@btn_exit_cb ))
IupSetCallback( btn_on_off, "ACTION", cast(Icallback,@btn_on_off_cb ))
IupSetCallback( btn_image , "ACTION", cast(Icallback,@btn_image_button_cb ))
IupShowXY( dlg, IUP_CENTER, IUP_CENTER )
IupMainLoop() |
Mein Problem ist : Wird der Dialog vergrößert expandieren die Frames schön mit der Größe des Dialoges mit. Aber wenn ich den Dialog unter die Startgröße verkleinere werden die Frames nicht mit verkleinert.
Hat wer einen Rat dazu ?
Grüße
Rainer |
|