VFF form loading on OS X
This shows VFF files being loaded and constructing a UI dynamically on OS X (Tiger). The UI is loaded dynamically from the visual form file, and the screenshot even shows a dialog called as a result of an event handler being installed on one of the dynamically created menu items.
You can see an example of some of the form file code here:
object Form1 : Window, 'ED88C0A1-26AB-11d4-B539-00C04F0196DA'
alignment = AlignNone
anchor = 0
autoStartDragDrop = false
border = @
borderSize = 0.00000
bottom = 555.00000
bottomBorderHeight = 0.00000
color.blue = 0.78431
color.green = 0.81569
color.red = 0.83137
container = @
doubleBuffered = true
enabled = true
font.bold = false
font.color.blue = 0.00000
font.color.green = 0.00000
font.color.red = 0.00000
font.italic = false
font.name = 'MS Sans Serif'
font.pointSize = 9.00000
font.strikeout = false
font.underlined = false
height = 537.00000
left = 24.00000
leftBorderWidth = 0.00000
name = 'Form1'
popupMenu = null
right = 589.00000
rightBorderWidth = 0.00000
tabOrder = 2
tabStop = false
tag = 53
toolTipText = ''
top = 18.00000
topBorderHeight = 0.00000
transparent = false
useColorForBackground = false
useParentFont = false
visible = true
whatThisHelpString = ''
width = 565.00000
object label1 : VCF::Label, 'ED88C09F-26AB-11d4-B539-00C04F0196DA'
anchor = [AnchorLeft,AnchorRight]
autoStartDragDrop = false
border = null
bottom = 100.00000
caption = 'This is a label!'
color.blue = 0.50000
color.green = 1.00000
color.red = 0.00000
container = null
doubleBuffered = true
enabled = true
focusControl = null
font.bold = false
font.color.blue = 0.00000
font.color.green = 0.00000
font.color.red = 0.00000
font.italic = false
font.name = 'MS Sans Serif'
font.pointSize = 9.00000
font.strikeout = false
font.underlined = false
height = 45.00000
left = 20.00000
name = 'label1'
popupMenu = null
right = 320.00000
tabOrder = 0
tabStop = false
tag = 279
textAlignment = taTextLeft
toolTipText = ''
top = 55.00000
transparent = false
useColorForBackground = true
useParentFont = false
verticalAlignment = tvaTextCenter
visible = true
whatThisHelpString = ''
width = 300.00000
wordWrap = false
delegates
end
end
object text1 : VCF::TextControl, 'ED88C09E-26AB-11d4-B539-00C04F0196DA'
alignment = AlignNone
anchor = 0
autoStartDragDrop = false
border = @
bottom = 176.00000
color.blue = 0.50000
color.green = 1.00000
color.red = 0.00000
container = null
doubleBuffered = true
enabled = true
font.bold = false
font.color.blue = 0.00000
font.color.green = 0.00000
font.color.red = 0.00000
font.italic = false
font.name = 'MS Sans Serif'
font.pointSize = 9.00000
font.strikeout = false
font.underlined = false
height = 35.00000
left = 242.00000
name = 'text1'
popupMenu = null
right = 542.00000
tabOrder = 1
tabStop = true
tag = 280
toolTipText = ''
top = 141.00000
useParentFont = false
visible = true
whatThisHelpString = ''
width = 300.00000
delegates
FocusGained = [
text1@TextControl::onFocusGained]
end
end
end
This is just a fragment, the actual file is a bit longer. The code to load this by hand is quite simple:
class VisualFormFilesApplication : public Application {
public:
VisualFormFilesApplication( int argc, char** argv ) : Application(argc, argv) {
}
virtual bool initRunningApplication(){
bool result = Application::initRunningApplication();
REGISTER_CLASSINFO_EXTERNAL(VisualFormFilesWindow);
VisualFormFilesWindow* w = (VisualFormFilesWindow*) Frame::createWindow( classid(VisualFormFilesWindow) );
setMainWindow(w);
w->show();
return result;
}
};
int main(int argc, char *argv[])
{
Application* app = new VisualFormFilesApplication( argc, argv );
Application::main();
return 0;
}
The framework does all the rest!


