void FormIndex::build()
{
dialog_ = build_index();
+
+ int w = form()->w;
+ int h = form()->h;
+
+ fl_set_form_minsize(form(), w, h);
+ fl_set_form_maxsize(form(), 2*w, h);
}
FL_FORM * const FormIndex::form() const
{
- if( dialog_ && dialog_->form_index )
+ if( dialog_ ) // no need to test for dialog_->form_index
return dialog_->form_index;
else
return 0;
void FormIndex::update()
{
- static int ow = -1, oh;
-
- if (ow < 0) {
- ow = dialog_->form_index->w;
- oh = dialog_->form_index->h;
-
- fl_set_form_minsize(dialog_->form_index, ow, oh);
- fl_set_form_maxsize(dialog_->form_index, 2*ow, oh);
- }
-
- fl_freeze_form( dialog_->form_index );
-
fl_set_input(dialog_->key, params.getContents().c_str());
if( lv_->buffer()->isReadonly() ) {
fl_activate_object( dialog_->ok );
fl_set_object_lcol( dialog_->ok, FL_BLACK );
}
-
- fl_unfreeze_form( dialog_->form_index );
}
if( inset_ != 0 )
{
// Only update if contents have changed
- if( params.getContents() != inset_->getContents() ) {
+ if( params != inset_->params() ) {
inset_->setParams( params );
lv_->view()->updateInset( inset_, true );
}