i try to experiment with embedded xdialogs browse on form by way of supercontrol.
i have these codes created from one of the test browse, name it dlgTitle and Modeless.
what changes do i need to do in order to make this browse appear on my form, currently it is a pop up xdialog.
appreciate your assistance,
thanks.
dim dlg_title as c
dim dlg_body as c
dim dlg_event as c
dim browseObj1_browse_definition as c
dim browseObj1_tablename as c
browseObj1_tablename = "temp_upd.dbf"
dim flagIsActiveLinkTable as l
flagIsActiveLinkTable = a5_is_activelinktable("temp_upd.dbf")
'If the browse is based on an ActiveLink table then it is necessary to include
'the {statusarea} directive in the Xdialog definition. This is where progress is reported
'when the active-link table is fetching records from the server.
dim StatusAreaCommand as c = ""
if flagIsActiveLinkTable then
StatusAreaCommand = "{sp=.5}{statusarea=100,1};"
end if
dlg_title = "DlgTitle"
dlg_body = <<%dlg%
'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment.
{removecomments}
{can_exit=close}
{startup=init}
{xmargin=0}{ymargin=0}
{stretch=height,width}
{watch=browseObj1.mode_get()!modechange}
{card=150,20BrowseCard_browseObj1};
%dlg%
dlg_body = stritran(dlg_body,"__StatusArea__",StatusAreaCommand)
dlg_event = <<%code%
if a_dlg_button = "close" then
ui_modeless_dlg_close(dlg_title)
end if
if a_dlg_button = "init"
a_dlg_button = ""
browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition")
'The status bar is only shown if the browse is based on an active-link table.
'When the browse is fetching data from the server, the status bar displays progress.
'However, when the browse is not fetching from the server, if the 'status_format' is not set to null, then
'the status bar will display 'Record x'. Since we don't want any display, we set the status_format to null.
'Note that the status_format can be set to any expression that evaluates in the context of the current record.
'e.g. "Record for" + lastname
browseObj1.Status_format = "\"\""
end if
if a_dlg_button = "browseObj1_NavigateFirst" then
a_dlg_button = ""
browseObj1.Fetch_First()
else if a_dlg_button = "browseObj1_NavigateNext" then
a_dlg_button = ""
browseObj1.Fetch_Next()
else if a_dlg_button = "browseObj1_NavigatePrevious" then
a_dlg_button = ""
browseObj1.Fetch_Prev()
else if a_dlg_button = "browseObj1_NavigateLast" then
a_dlg_button = ""
browseObj1.Fetch_Last()
else if a_dlg_button = "browseObj1_FindByKey" then
a_dlg_button = ""
browseObj1.Find()
else if a_dlg_button = "browseObj1_SortAscending" then
a_dlg_button = ""
browseObj1.command("SORT_ASCENDING")
else if a_dlg_button = "browseObj1_SortDescending" then
a_dlg_button = ""
browseObj1.command("SORT_DESCENDING")
else if a_dlg_button = "browseObj1_SaveRecord" then
a_dlg_button = ""
browseObj1.commit()
else if a_dlg_button = "browseObj1_RefreshRecord" then
a_dlg_button = ""
browseObj1.command("REFRESH")
end if
%code%
browseObj1_browse_definition = <<%xml%
<browse gridline_horizontal="yes" gridline_vertical="yes" data_entry_style="default" row_height="16">
<title showtitles="yes" color="System-ButtonFace" accent_color="System-ButtonHighlight" fill_style="Gradient Horizontal" line_style="solid" line_color="System-ThreeDShadow" top="2" onclick_behaviour="Select">
<font color="System-ButtonText" name="Arial" size="8"/>
<flyover color="#224,244,244" accent_color="#195,195,195" fill_style="Gradient Horizontal"/>
<selected color="#241,193,95" accent_color="#249,217,159" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
<focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
</title>
<background color="White" accent_color="Black" fill_style="Transparent"/>
<row_selector color="Win3D" accent_color="Black" fill_style="Transparent" line_style="solid" line_color="System-ThreeDShadow">
<selected color="#255,213,141" accent_color="Black" fill_style="Solid"/>
<focused color="#241,192,92" accent_color="Black" fill_style="Solid"/>
</row_selector>
<splitter color="Win3D"/>
<horizontal line_color="System-ButtonFace" line_style="solid"/>
<vertical line_color="System-ButtonFace" line_style="solid"/>
<separator_top line_style="default"/>
<separator_bottom line_style="default"/>
<separator_left line_style="default"/>
<separator_right line_style="default"/>
<cells>
<cell color="#255,255,255" accent_color="#255,255,255" fill_style="Solid" font_color="#0,0,0" count="1"/>
<cell color="#244,244,255" accent_color="#244,244,255" fill_style="Solid" font_color="#0,0,0" count="1"/>
</cells>
<selected color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<focused color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<currentrow color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<currentcolumn color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<new_record_appearance color="Win3D" accent_color="Off White" fill_style="Transparent"/>
<font size="2"/>
<font size="2"/>
<columns>
<column name="UPD" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->UPD" width="6"/>
<object name="UPD" column_title="UPD" width="0.666666666666667"/>
</column>
<column name="UPD_DESC" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->UPD_DESC" width="50"/>
<object name="UPD_DESC" column_title="UPD_DESC" width="3.5"/>
</column>
<column name="MFTR_NUMBER" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->MFTR_NUMBER" width="50"/>
<object name="MFTR_NUMBER" column_title="MFTR_NUMBER" width="3.5"/>
</column>
<column name="TABLE_ID" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->TABLE_ID" width="8"/>
<object name="TABLE_ID" column_title="TABLE_ID" width="0.885416666666667"/>
</column>
<column name="DATA_DATE" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->DATA_DATE" width="8"/>
<object name="DATA_DATE" column_title="DATA_DATE" width="0.885416666666667"/>
</column>
</columns>
</browse>
%xml%
'Now, display the Xdialog.
ui_modeless_dlg_box(dlg_title,dlg_body,dlg_event)
i have these codes created from one of the test browse, name it dlgTitle and Modeless.
what changes do i need to do in order to make this browse appear on my form, currently it is a pop up xdialog.
appreciate your assistance,
thanks.
dim dlg_title as c
dim dlg_body as c
dim dlg_event as c
dim browseObj1_browse_definition as c
dim browseObj1_tablename as c
browseObj1_tablename = "temp_upd.dbf"
dim flagIsActiveLinkTable as l
flagIsActiveLinkTable = a5_is_activelinktable("temp_upd.dbf")
'If the browse is based on an ActiveLink table then it is necessary to include
'the {statusarea} directive in the Xdialog definition. This is where progress is reported
'when the active-link table is fetching records from the server.
dim StatusAreaCommand as c = ""
if flagIsActiveLinkTable then
StatusAreaCommand = "{sp=.5}{statusarea=100,1};"
end if
dlg_title = "DlgTitle"
dlg_body = <<%dlg%
'If you include the {removecomments} command, any line that starts with an single quote will be treated as a comment.
{removecomments}
{can_exit=close}
{startup=init}
{xmargin=0}{ymargin=0}
{stretch=height,width}
{watch=browseObj1.mode_get()!modechange}
{card=150,20BrowseCard_browseObj1};
%dlg%
dlg_body = stritran(dlg_body,"__StatusArea__",StatusAreaCommand)
dlg_event = <<%code%
if a_dlg_button = "close" then
ui_modeless_dlg_close(dlg_title)
end if
if a_dlg_button = "init"
a_dlg_button = ""
browseObj1 = a5_XdialogDefaultBrowse(dlg_title,"Browsecard_browseObj1",browseObj1_tablename,"browseObj1_browse_definition")
'The status bar is only shown if the browse is based on an active-link table.
'When the browse is fetching data from the server, the status bar displays progress.
'However, when the browse is not fetching from the server, if the 'status_format' is not set to null, then
'the status bar will display 'Record x'. Since we don't want any display, we set the status_format to null.
'Note that the status_format can be set to any expression that evaluates in the context of the current record.
'e.g. "Record for" + lastname
browseObj1.Status_format = "\"\""
end if
if a_dlg_button = "browseObj1_NavigateFirst" then
a_dlg_button = ""
browseObj1.Fetch_First()
else if a_dlg_button = "browseObj1_NavigateNext" then
a_dlg_button = ""
browseObj1.Fetch_Next()
else if a_dlg_button = "browseObj1_NavigatePrevious" then
a_dlg_button = ""
browseObj1.Fetch_Prev()
else if a_dlg_button = "browseObj1_NavigateLast" then
a_dlg_button = ""
browseObj1.Fetch_Last()
else if a_dlg_button = "browseObj1_FindByKey" then
a_dlg_button = ""
browseObj1.Find()
else if a_dlg_button = "browseObj1_SortAscending" then
a_dlg_button = ""
browseObj1.command("SORT_ASCENDING")
else if a_dlg_button = "browseObj1_SortDescending" then
a_dlg_button = ""
browseObj1.command("SORT_DESCENDING")
else if a_dlg_button = "browseObj1_SaveRecord" then
a_dlg_button = ""
browseObj1.commit()
else if a_dlg_button = "browseObj1_RefreshRecord" then
a_dlg_button = ""
browseObj1.command("REFRESH")
end if
%code%
browseObj1_browse_definition = <<%xml%
<browse gridline_horizontal="yes" gridline_vertical="yes" data_entry_style="default" row_height="16">
<title showtitles="yes" color="System-ButtonFace" accent_color="System-ButtonHighlight" fill_style="Gradient Horizontal" line_style="solid" line_color="System-ThreeDShadow" top="2" onclick_behaviour="Select">
<font color="System-ButtonText" name="Arial" size="8"/>
<flyover color="#224,244,244" accent_color="#195,195,195" fill_style="Gradient Horizontal"/>
<selected color="#241,193,95" accent_color="#249,217,159" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
<focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="System-ButtonText"/>
</title>
<background color="White" accent_color="Black" fill_style="Transparent"/>
<row_selector color="Win3D" accent_color="Black" fill_style="Transparent" line_style="solid" line_color="System-ThreeDShadow">
<selected color="#255,213,141" accent_color="Black" fill_style="Solid"/>
<focused color="#241,192,92" accent_color="Black" fill_style="Solid"/>
</row_selector>
<splitter color="Win3D"/>
<horizontal line_color="System-ButtonFace" line_style="solid"/>
<vertical line_color="System-ButtonFace" line_style="solid"/>
<separator_top line_style="default"/>
<separator_bottom line_style="default"/>
<separator_left line_style="default"/>
<separator_right line_style="default"/>
<cells>
<cell color="#255,255,255" accent_color="#255,255,255" fill_style="Solid" font_color="#0,0,0" count="1"/>
<cell color="#244,244,255" accent_color="#244,244,255" fill_style="Solid" font_color="#0,0,0" count="1"/>
</cells>
<selected color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<focused color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<currentrow color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<currentcolumn color="System-Highlight" accent_color="Black" fill_style="Solid" font_color="System-HighlightText"/>
<new_record_appearance color="Win3D" accent_color="Off White" fill_style="Transparent"/>
<font size="2"/>
<font size="2"/>
<columns>
<column name="UPD" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->UPD" width="6"/>
<object name="UPD" column_title="UPD" width="0.666666666666667"/>
</column>
<column name="UPD_DESC" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->UPD_DESC" width="50"/>
<object name="UPD_DESC" column_title="UPD_DESC" width="3.5"/>
</column>
<column name="MFTR_NUMBER" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->MFTR_NUMBER" width="50"/>
<object name="MFTR_NUMBER" column_title="MFTR_NUMBER" width="3.5"/>
</column>
<column name="TABLE_ID" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->TABLE_ID" width="8"/>
<object name="TABLE_ID" column_title="TABLE_ID" width="0.885416666666667"/>
</column>
<column name="DATA_DATE" align="Left" text_format="None">
<font color="<default>" name="Tahoma" size="8"/>
<border color="Black" style="No border" has_left_edge="yes" has_right_edge="yes" has_top_edge="yes" has_bottom_edge="yes"/>
<fill color="<default>" accent_color="White" style="Transparent"/>
<shadow style="None"/>
<entry name="temp_upd->DATA_DATE" width="8"/>
<object name="DATA_DATE" column_title="DATA_DATE" width="0.885416666666667"/>
</column>
</columns>
</browse>
%xml%
'Now, display the Xdialog.
ui_modeless_dlg_box(dlg_title,dlg_body,dlg_event)
Comment