Slick Forums

Discuss the Slick 2D Library
It is currently Wed Nov 20, 2019 5:06 am

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Mar 04, 2014 2:42 pm 

Joined: Thu Feb 27, 2014 2:22 pm
Posts: 1
Hello everyone,

I'm currently working on a simple widget which contains play/pause/stop buttons and a progress bar. I've successfully integrated it in an OpenGL application and it is displayed on top of a video.

I have however problems with the DialogLayout in it. I'm trying to make the progress bar take all the possible width without setting its size manually. I would like to let the layout do the job for me. Here is the sample code for my example:

      btnPlay = new Button();

      btnPause = new Button();

      btnStop = new Button();

      lblBegin = new Label("0:00");

      lblEnd = new Label("2:00");

      bar = new ProgressBar();

      videoLayout = new DialogLayout();

      Group horizontalGroup = videoLayout.createSequentialGroup();
      horizontalGroup.addWidget(btnPlay, Alignment.CENTER);
      horizontalGroup.addWidget(btnPause, Alignment.CENTER);
      horizontalGroup.addWidget(btnStop, Alignment.CENTER);
      horizontalGroup.addWidget(lblBegin, Alignment.CENTER);
      horizontalGroup.addWidget(bar, Alignment.FILL);
      horizontalGroup.addWidget(lblEnd, Alignment.CENTER);

      Group verticalGroup = videoLayout.createParallelGroup();
      verticalGroup.addWidget(btnPlay, Alignment.FILL);
      verticalGroup.addWidget(btnPause, Alignment.FILL);
      verticalGroup.addWidget(btnStop, Alignment.FILL);
      verticalGroup.addWidget(lblBegin, Alignment.FILL);
      verticalGroup.addWidget(lblEnd, Alignment.FILL);


This widget is in the root panel of my GUI and I use adjustSize() methods in the layout() method of both root panel and widget.
But the sizes chosen by the layout are the min sizes. I have put in the XML the maxWidth to the MAX but it doesn't work

Does someone have a clue ?
Thank you,

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 45 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group