bool OnPostCreate()
{
- if(type && !readOnly && (type.type == normalClass || type.type == noHeadClass || data))
+ if(type && (!readOnly || (autoSize && type._vTbl[__ecereVMethodID_class_OnEdit] == class(Instance)._vTbl[__ecereVMethodID_class_OnEdit])) &&
+ (type.type == normalClass || type.type == noHeadClass || data))
{
// IMPORTANT FIX: If keepEditor is true, we were passing editor rather than the editor's current master
editor = (Window)type._vTbl[__ecereVMethodID_class_OnEdit](type,
PrintLn("DataBox::OnPostCreate -- autoSize == true");
#endif*/
if(eClass_IsDerived(editor._class, class(EditBox)))
+ {
+ ((EditBox)editor).readOnly = readOnly;
((EditBox)editor).autoSize = autoSize;
+ }
}
else
{
void OnRedraw(Surface surface)
{
- if(type)
+ if(type && !editor)
{
char tempString[1024];
if(type._vTbl[__ecereVMethodID_class_OnDisplay] == class(Instance)._vTbl[__ecereVMethodID_class_OnDisplay])
window, master = master, visible = false, //position = { x, y },
borderStyle = 0,
modifyVirtualArea = false, //sizeAnchor = { { w, h }, isClientH = true };
- autoSize = (eClass_IsDerived(window._class, class(DataBox)) ? ((DataBox)window).autoSize : false),
- anchor = { 0, 0, 0, 0 };
+ autoSize = (eClass_IsDerived(window._class, class(DataBox)) ? ((DataBox)window).autoSize : false);
void DataBox::NotifyUpdate(EditBox editBox)
{
bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
{
- opacity = active ? 1.0f : parent.opacity;
+ opacity = (active && !readOnly) ? 1.0f : parent.opacity;
return EditBox::OnActivate(active, previous, goOnWithActivation, direct);
}
};
+ if(!editBox.autoSize)
+ editBox.anchor = { 0, 0, 0, 0 };
+ else
+ editBox.anchor = { 0, 0 };
+
if(data)
{
bool needClass = false;
void AddFieldBox(FieldBox fieldBox)
{
+ // I was putting this here to force autosize on the lists (e.g. the Radiologists fields):
+ /*
+ if(!fieldBox.autoSize)
+ fieldBox.autoSize = true;
+ */
DebugLn("TableEditor::AddFieldBox");
if(!fieldsBoxes.Find(fieldBox))
{
fb.Load();
OnCreateDynamicLookupEditors();
internalModifications = false;
+ size = size; // This seems to be required to fix autoSize on entering order screen
DebugLn(" TODO: implement virtual method TableEditor::OnSubEditorsLoad");