Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

x_Dialog Tab Stops

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: x_Dialog Tab Stops

    Thats it. The resulting code is quite verbose but quicker to achieve result in many cases
    In this example I eliminated well over 100 lines of unneeded code.
    I forgot how I eliminated the row_selector, did a while back in an example.

    Comment


      #17
      Re: x_Dialog Tab Stops

      Dup.
      Last edited by Ray in Capetown; 04-12-2015, 07:08 PM.

      Comment


        #18
        Re: x_Dialog Tab Stops

        Actually the code in #14 is fairly generic, you can point it at your own or just about any other table - change the tablename on line 10.
        The column names will default to the fieldnames.
        If you want to filter the viewed data then set a query on that table before running it - it will use the last used table query.
        Last edited by Ray in Capetown; 04-12-2015, 07:10 PM.

        Comment


          #19
          Re: x_Dialog Tab Stops

          Hello Ray,

          I want to lean about the XML Browse and ListBox layout. Can you teach me what to do at " browseObj1_browse_definition " with this sample?


          Code:
          'Copy from my library but not know the origin
          
          'vInvItem = table.external_record_content_get("invoiceitem",\
          '"Invoice_Number+'{T=0.5}'+Product_Id+'{T=1.0}'+Description+'{T=3.0}'+str(Price,8,2)+'{T=4.0}'+Quantity+'{T=5.0}'+Extension","","")
          'showvar(vInvItem)
          
          'sample data
          vInvItem=<<%str%
          000001{T=0.5}P003        {T=1.0}Nuprene 1 Qt. Bottle            {T=3.0}    3.99{T=4.0}4{T=5.0}15.96
          000001{T=0.5}P001        {T=1.0}UnoFold Quick Dry Socks         {T=3.0}    5.99{T=4.0}6{T=5.0}35.94
          000001{T=0.5}P033        {T=1.0}Pearlman Propane Canister       {T=3.0}    3.99{T=4.0}3{T=5.0}11.97
          000001{T=0.5}P106        {T=1.0}Nykey Aerobic Shoes (M)         {T=3.0}   49.99{T=4.0}1{T=5.0}49.99
          000001{T=0.5}P060        {T=1.0}Noonan's 48 Qt Cooler           {T=3.0}   24.99{T=4.0}2{T=5.0}49.98
          000002{T=0.5}P001        {T=1.0}UnoFold Quick Dry Socks         {T=3.0}    5.99{T=4.0}3{T=5.0}17.97
          000004{T=0.5}P011        {T=1.0}Ray Block Sunglasses            {T=3.0}   47.11{T=4.0}1{T=5.0}47.11
          000004{T=0.5}P019        {T=1.0}Techelon Hybrid Racquet         {T=3.0}   94.24{T=4.0}1{T=5.0}94.24
          000004{T=0.5}P034        {T=1.0}Reeler's 40 # Fishing Line 200' {T=3.0}    5.30{T=4.0}2{T=5.0}10.6
          000005{T=0.5}P005        {T=1.0}Black Forest Bug Repellant      {T=3.0}    3.52{T=4.0}1{T=5.0}3.52
          000005{T=0.5}P006        {T=1.0}Arctic Trek Dome Tent           {T=3.0}  353.42{T=4.0}1{T=5.0}353.42
          000006{T=0.5}P012        {T=1.0}DuoFold Quick Dry Socks         {T=3.0}    7.06{T=4.0}3{T=5.0}21.18
          000003{T=0.5}P010        {T=1.0}Slazinger Cricket Bat           {T=3.0}  235.61{T=4.0}1{T=5.0}235.61
          000003{T=0.5}P013        {T=1.0}MaxiMag Replacement Bulbs       {T=3.0}    4.70{T=4.0}2{T=5.0}9.4
          000007{T=0.5}P018        {T=1.0}Techelon Safety Glasses         {T=3.0}   15.25{T=4.0}1{T=5.0}15.25
          000007{T=0.5}P012        {T=1.0}DuoFold Quick Dry Socks         {T=3.0}    7.06{T=4.0}1{T=5.0}7.06
          %str%
          
          dim browseObj1_browse_definition as c 
          dim browseObj1_tablename as c 
          
          browseObj1_tablename = "invoiceitem.dbf"
          
          dim flagIsActiveLinkTable as l 
          flagIsActiveLinkTable = a5_is_activelinktable("invoiceitem.dbf")
          dim StatusAreaCommand as c = ""
          if flagIsActiveLinkTable then 
          	StatusAreaCommand = "{sp=.5}{statusarea=100,1};"
          end if
          
          ok_button_label = "&OK"
          cancel_button_label = "&Cancel"
          
          varC_result = ui_dlg_box("AlphaSports invoice Items list",<<%dlg%
          {Background=#254+254+193}
          
          {region}
          Standard A5 ListBox;
          item list:| [%O={@@}%.140,10vItem^#vInvItem];
          {endregion};
          
          {region}
          XML listBox;
          {watch=browseObj1.mode_get()!modechange}
          {card=80,8BrowseCard_browseObj1};
           
          {endregion};
          
          {line=1,0};
          {region}
          <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
          {endregion};
          %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 width="1194" height="494" data_entry_style="default" gridline_horizontal="yes" gridline_vertical="yes" restrict_split="yes" row_height="16">
          	<code>
          		<OnRowChange>msgbox("just show","Hello ")</OnRowChange>
          	</code>
          	<title showtitles="yes" color="Win3D" accent_color="White" fill_style="Gradient Horizontal" line_style="solid" line_color="Gray-25" top="2" onclick_behaviour="Select">
          		<font color="Buttontext" name="Tahoma" size="8" bold="yes"/>
          		<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="Black"/>
          		<focused color="#242,149,54" accent_color="#255,213,141" fill_style="Gradient Horizontal" font_color="Black"/>
          	</title>
          	<background color="Win3D" accent_color="Black" fill_style="Transparent"/>
          		<row_selector color="Win3D" accent_color="Win3D" fill_style="Solid" line_style="solid" line_color="Gray-25">
          			<selected color="#255,213,141" accent_color="Black" fill_style="Solid"/>
          			<focused color="#241,192,92" accent_color="#0,0,0" fill_style="Solid"/>
          		</row_selector>
          		<splitter color="Win3D"/>
          		<horizontal line_color="Gray-40" line_style="default"/>
          		<vertical line_color="Gray-40" line_style="default"/>
          		<separator_top 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"/>
          		</cells>
          		<selected color="System-Highlight" accent_color="System-Highlight" fill_style="Transparent" font_color="System-HighlightText"/>
          		<focused color="#210,213,218" accent_color="#0,0,0" fill_style="Solid"/>
          		<currentrow color="System-Highlight" accent_color="System-Highlight" fill_style="Transparent" font_color="System-HighlightText"/>
          		<currentcolumn color="System-Highlight" accent_color="System-Highlight" fill_style="Transparent" font_color="System-HighlightText"/>
          		<new_record_appearance color="Winback" accent_color="Winback" fill_style="Solid" font_color="Wintext"/>
          		<font size="2"/>
          		<font size="2"/>
          		<initial width="1194" height="494"/>
          		<font size="2"/>
          		<font size="2"/>
          		<font size="2"/>
          		<font size="2"/>
          		<font size="2"/>
          	<columns>
          		<column name="product" align="Left" text_format="None">
          			<font color="&lt;default&gt;" 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="&lt;default&gt;" accent_color="White" style="Transparent"/>
          			<shadow style="None"/>
          			<entry name="rolodex-&gt;Product" width="25"/>
          			<object name="Product" column_title="Product" width="1.1875"/>
          		</column>
          		<column name="Description" align="Left" text_format="None">
          			<font color="&lt;default&gt;" 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="&lt;default&gt;" accent_color="White" style="Transparent"/>
          			<shadow style="None"/>
          			<entry name="rolodex-&gt;Description" width="50"/>
          			<object name="Description" column_title="Description" width="0.666666666666667"/>
          		</column>
          		<column name="Price" align="Left" text_format="None">
          			<font color="&lt;default&gt;" 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="&lt;default&gt;" accent_color="White" style="Transparent"/>
          			<shadow style="None"/>
          			<entry name="rolodex-&gt;Price" width="25"/>
          			<object name="Price" column_title="Price" width="1.13542"/>
          		</column>
          	</columns>
          </browse>
          %xml%
          
          'Now, display the Xdialog.
          ui_dlg_box(dlg_title,dlg_body,dlg_event)

          Comment


            #20
            Re: x_Dialog Tab Stops

            Originally posted by johnkoh View Post
            Hello Ray,

            I want to lean about the XML Browse and ListBox layout. Can you teach me what to do at " browseObj1_browse_definition " with this sample?
            Hi Joh Koh -
            I go back to here http://www.alphasoftware.com/alphafo...owse+%2Bdialog when Alan B got me in touch with this method. You were there and Tom may recall as well.
            By using the conversion tool from a browse in edit set up exactly the way you want will instantly create the whole code for displaying a browse in a dialog.

            Question to you
            What do you WANT to do ?
            That may be easier to answer.

            Prompted by Tom's question I have advanced my earlier sample code to a udf that with a few parameters can be called to open any table embedded in dialog with easily filtered records, to be editable or not.
            Tom you could try this as a quick method to provide the "lookups in dialog" that you require, until you have more time to refine later.
            I will be using this in a current project within which tasks and targets are set and allocated to specified employees whereby any employee can see any data over a variety of tables, filtered for their eyes only.
            I was up to now creating individual scripts for each table. I can scrap all those and use this generic udf.
            I will post a preliminary if anyone is interested. its actually quite small and very quick.

            Comment


              #21
              Re: x_Dialog Tab Stops

              Ray,

              What do you WANT to do ?
              I want to know
              (1) how to create the list box or Browse which linked with tables by HTML method.
              (2) how to set a filter with HTML

              I have the align problem with ListBox and the " fillable/changeable field " layout has gap between line-to-line.

              Comment


                #22
                Re: x_Dialog Tab Stops

                Originally posted by johnkoh View Post
                Ray,
                I want to know
                (1) how to create the list box or Browse which linked with tables by HTML method.
                (2) how to set a filter with HTML.
                (1) is answered in the post before
                By using the conversion tool from a browse in edit set up exactly the way you want will instantly create the whole code for displaying a browse in a dialog.
                did you do this?

                (2) I don't do in the XML code. It's inflexible and cant be changed dynamically easily, and I prefer not to have extra global variables.
                There's no HTML code involved.
                Can be done with a shared filter variable in the dialog, or a value of a field in an open table table->fieldval.
                at the point of startup and whenever a button is pressed like here...
                if a_dlg_button <> "close" then
                ' ev=eval("ptr"+"."+fld) 'ptr passed as a parameter to this function is the open table of the master
                ' browseObj1.QueryRun("code=" + quote(ev),"date") 'the value in ptr table field is the gltran code to filter
                or
                browseObj1.QueryRun(cqry,"date") 'where cqry is set at the start of the function such as cqry="code=" + quote(tcode) (where tcode passed as a parameter to this function).
                browseObj1.Fetch_Last()

                I have more recently been setting the query on the table and the XML command filter="*remembered() quite successfully.
                Last edited by Ray in Capetown; 04-13-2015, 05:48 PM.

                Comment


                  #23
                  Re: x_Dialog Tab Stops

                  Ray,

                  Thank you for the filter direction -- " browseObj1.QueryRun("code=" + quote(ev),"date") "
                  Attached Files

                  Comment


                    #24
                    Re: x_Dialog Tab Stops

                    Ray,

                    What about the ListBox? - How to create it (*still do not understand post # 14)?

                    Comment


                      #25
                      Re: x_Dialog Tab Stops

                      started as you did (nice example)
                      Before converting turned off the nav buttons ... by unchecking :"Show Close" and "Show Buttons", set restrictions on all editing and took out all the lines relating to each column **
                      Take a look at your code you will see similar lines of code to those I have kept.

                      ** I use those only when I need conditional colours and highlights

                      Comment


                        #26
                        Re: x_Dialog Tab Stops

                        I achieved what I wanted without all the xml code.

                        I just redefined my tab stops for the list and pushed the last 2 fields over by a little bit.

                        Code:
                        dim heading as C = "Date|Type|Hours|AM/PM|Approved"
                        
                        Dim format as p 
                        [COLOR="#FF0000"]Format.tab_stops=".8,1.7,2.4,3.1"[/COLOR]
                        Format.font="Arial,10,b"
                        Format.odd_row_color="#254+254+193"
                        Format.font_color_unselected="Red"
                        heading = a5_owner_draw_list_fmt(heading,Format)
                        Format.font="Arial,10"
                        [COLOR="#FF0000"]Format.tab_stops=".8,1.7,2.5,3.35"[/COLOR]
                        Format.odd_row_color="White"
                        Format.even_row_color="Blue White"
                        Format.font_color_unselected="Blue"
                        Format.font_color_selected="White"
                        Format.alternating_bands=.t.
                        list = a5_owner_draw_list_fmt(list,Format)
                        resulting in the attached dialog

                        Sometimes the simple solution is staring you right in the face!

                        Time Off.jpg

                        Tom

                        Tom

                        Comment


                          #27
                          Re: x_Dialog Tab Stops

                          Hi Tom,

                          Except your numbers are still not aligned. Ray's suggestion of the browse converted to XD would accomplish that - and you could set your browse events, formatting, size, etc. first and paste the whole code into a function. Then tweak the XD with your buttons and events and add a parameter to call it with a filter and all sorts of other stuff. You don't even have to mess with the XML part.
                          Robin

                          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                          Comment


                            #28
                            Re: x_Dialog Tab Stops

                            Robin,

                            This screenshot came from "Displaying data from a set" Help.
                            display datafromset.jpg

                            What would you do to make the listbox with XML? -> specially, How do you get the (Invoice item Table) records by header record?

                            Comment


                              #29
                              Re: x_Dialog Tab Stops

                              Originally posted by johnkoh View Post
                              Robin,

                              This screenshot came from "Displaying data from a set" Help.
                              [ATTACH=CONFIG]40150[/ATTACH]

                              What would you do to make the listbox with XML? -> specially, How do you get the (Invoice item Table) records by header record?
                              Sounds like a good question for Tim Kiebert...not me!
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment


                                #30
                                Re: x_Dialog Tab Stops

                                Tom
                                You may prefer the look if you change
                                Code:
                                +alltrim(str(req_hrs,6,2))+
                                to
                                Code:
                                +req_hrs+
                                It doesnt space in a fixed font manner but proportionately appears at lead a little more centered.

                                Comment

                                Working...
                                X