void Sats3::DoDrops() { // Populate the drop lists SQL*Select(Code).From(Generation); while(SQL.Fetch()) ist.dGen.Add(SQL[0]); SQL*Select(Code).From(EdCode); while(SQL.Fetch()) ist.dEdCode.Add(SQL[0]); SQL*Select(Code).From(Sex); while(SQL.Fetch()) ist.dSex.Add(SQL[0]); SQL*Select(Code).From(Race); while(SQL.Fetch()) ist.dRace.Add(SQL[0]); SQL*Select(Code).From(Ethnic); while(SQL.Fetch()) ist.dEthnic.Add(SQL[0]); SQL*Select(Code).From(EnlType); while(SQL.Fetch()) ist.dEnlType.Add(SQL[0]); SQL*Select(Code).From(Area); while(SQL.Fetch()) mis.txtOpsArea.Add(SQL[0]); }
void SATS3::Populate (const char *field, const char *table, const char *tab, const char *control) { SQL*Select(field).From(table); while(SQL.Fetch()) tab.control.Add(SQL[0]); }
Populate("Code", "Area", "ist", "dEnlType");
void Sats3::DoDrops() { static const ...FromType.. _from[] = {Generation, EdCode, Sex, Race, ..., Area}; static const ...ControlTypePtr... _ctrl[] = {ist.dGen, ist.dEdCode, ..., mis.txtOpsArea}; //all controls must be derived from the same "..ControlType..." //and implement virtual "Add" function with same interface for (int i = 0; i < sizeof(_from)/sizeof(...FromType..); ++i ) { SQL*Select(Code).From(_from[i]); while(SQL.Fetch()) _ctrl[i]->Add(SQL[0]); } }
SQL*Select(column).From(table); while(SQL.Fetch()) tabcontrol.dropdownWidget.Add(SQL[0]);
Populate(Code, Area, istdEnlType);
void SATS3::Populate (const SqlId& field, const SqlId& table, DropList& control) { SQL*Select(field).From(table); while(SQL.Fetch()) control.Add(SQL[0]); }
void SATS3::Populate (const char *field, const char *table, const char *tab, const char *control) { SQL*Select(field).From(table); while(SQL.Fetch()) tab.control.Add(SQL[0]); }
Populate("Code", "Area", "ist", "dEnlType");
tab.control *= Select(Code).From(Generation);
tab.contro *= Select(Key, Code).From(Generation);
C:\Development\MyApps\Sats3\Sats3.cpp(16) : error C2678: binary '*=' : no operator found which takes a left-hand operand of type 'Upp::D ropList' (or there is no acceptable conversion) C:\Development\upp\uppsrc\Core/Gtypes.h(582): could be 'Upp::Size &Upp::operator *=(Upp::Size &,double)' C:\Development\upp\uppsrc\Core/Gtypes.h(596): or 'Upp::Size &Upp::operator *=(Upp::Size &,Upp::Sizef)' C:\Development\upp\uppsrc\Core/Gtypes.h(617): or 'Upp::Size16 &Upp::operator *=(Upp::Size16 &,double)' C:\Development\upp\uppsrc\Core/Gtypes.h(631): or 'Upp::Size16 &Upp::operator *=(Upp::Size16 &,Upp::Sizef)' C:\Development\upp\uppsrc\RichText/RichText.h(37): or 'void Upp::operator *=(int &,Upp::Zoom)' C:\Development\upp\uppsrc\RichText/RichText.h(42): or 'void Upp::operator *=(Upp::Rect &,Upp::Zoom)' c:\development\upp\uppsrc\richtext\Para.h(282): or 'void Upp::operator *=(Upp::RichPara::Format &,Upp::Zoom)' c:\development\upp\uppsrc\sql\Sqlexp.h(191): or 'Upp::SqlVal &Upp::operator *=(Upp::SqlVal &,const Upp::SqlVal &)' while trying to match the argument list '(Upp::DropList, Upp::SqlSelect)'
C:\Development\MyApps\Sats3\Sats3.cpp(16) : error C2678: binary '*=' : no operator found which takes a left-hand operand of type 'Upp::D ropList' (or there is no acceptable conversion) C:\Development\upp\uppsrc\Core/Gtypes.h(582): could be 'Upp::Size &Upp::operator *=(Upp::Size &,double)' C:\Development\upp\uppsrc\Core/Gtypes.h(596): or 'Upp::Size &Upp::operator *=(Upp::Size &,Upp::Sizef)' C:\Development\upp\uppsrc\Core/Gtypes.h(617): or 'Upp::Size16 &Upp::operator *=(Upp::Size16 &,double)' C:\Development\upp\uppsrc\Core/Gtypes.h(631): or 'Upp::Size16 &Upp::operator *=(Upp::Size16 &,Upp::Sizef)' C:\Development\upp\uppsrc\RichText/RichText.h(37): or 'void Upp::operator *=(int &,Upp::Zoom)' C:\Development\upp\uppsrc\RichText/RichText.h(42): or 'void Upp::operator *=(Upp::Rect &,Upp::Zoom)' c:\development\upp\uppsrc\richtext\Para.h(282): or 'void Upp::operator *=(Upp::RichPara::Format &,Upp::Zoom)' c:\development\upp\uppsrc\sql\Sqlexp.h(191): or 'Upp::SqlVal &Upp::operator *=(Upp::SqlVal &,const Upp::SqlVal &)' while trying to match the argument list '(Upp::DropList, Upp::SqlSelect)'