Home   Help Search Login Register  

Author Topic: Dialog trouble  (Read 1374 times)

0 Members and 1 Guest are viewing this topic.

XPS

  • Guest
Dialog trouble
« on: 26 Jul 2006, 15:37:10 »
Hi,

I have a dialog with a few buttons and a listbox. When I click a button, I want to change the height of the listbox.
The problem is, you can change things in a dialog before you have opened it.

In this case the dialog is allready open (because you need to click on a button).

How can I do this?

Offline nindall

  • Members
  • *
Re: Dialog trouble
« Reply #1 on: 26 Jul 2006, 18:41:55 »
I would guess you're using global variables to change the value, if so just close the dialog & then create it again (AFAIK, there isn't a better way) -

Code: [Select]
closeDialog 0
_dlg = createDialog "Dialog"
? !(_dlg) : hint "Dialog error!"

Hope it'll work in your situation!

XPS

  • Guest
Re: Dialog trouble
« Reply #2 on: 27 Jul 2006, 01:53:31 »
Closing and opening the dialog is a good idea.
But I still don't know how to change the height of a listbox. Can anyone give me an example of that?

Thanks
« Last Edit: 27 Jul 2006, 01:57:33 by XPS »

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re: Dialog trouble
« Reply #3 on: 27 Jul 2006, 03:37:57 »
In your dialogue you have to create 2 listboxes the sizes that you want, then you hide and unhide them as needed using the "ctrlshow" command.
--Ben

XPS

  • Guest
Re: Dialog trouble
« Reply #4 on: 27 Jul 2006, 13:46:31 »
So there is no possible way to give a variable to the height of the listbox.
And change that before you create a new dialog?

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re: Dialog trouble
« Reply #5 on: 27 Jul 2006, 14:55:44 »
Hey there !



There are ways, but :

  • are you using a list box or a combo (i.e. a collapsable listbox) ?
  • do you want to change the height of the entire listbox, or only the row heights ?

In any case, just assign a global variable in the description.ext to what you want to change, and adjust the variable after closing the dialog and on re-creating it, as nindall suggested.

XPS

  • Guest
Re: Dialog trouble
« Reply #6 on: 27 Jul 2006, 15:08:23 »
Ah great.

The thing I did wrong:
I used _Height in my description.ext and my script.

I needed to use: Height
(Without underscore)  8)

So that is solved :D

But I need to know 1 more thing, what is the difference between a global variable and a local variable?
Is a variable with an underscore local or global?

Offline Igor Drukov

  • Contributing Member
  • **
  • Conscientious Subjector
Re: Dialog trouble
« Reply #7 on: 27 Jul 2006, 15:11:58 »
The answer is in what you've just written ;)

Underscore is local, without, global.

XPS

  • Guest
Re: Dialog trouble
« Reply #8 on: 27 Jul 2006, 15:37:25 »
Thanks  ;D