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

Select all/Select none checkbox in dialog

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

    Select all/Select none checkbox in dialog

    I have a dialog box with multiple checkbox options. I am trying to add an option for 'select all' and another to 'select none'.

    This sort of works, but...

    Code:
    If vSelectAll = .t.
    	voption1 = .t.
    	voption2 = .t.
    	voption3 = .t.
    	voption4 = .t.
    	voption5 = .t.
    	voption6 = .t.
    	voption7 = .t.
    	voption8 = .t.
    	voption9 = .t.
    	vSelectNone = .f.
    End If
    If vSelectNone = .t.
    	voption1 = .f.
    	voption2 = .f.
    	voption3 = .f.
    	voption4 = .f.
    	voption5 = .f.
    	voption6 = .f.
    	voption7 = .f.
    	voption8 = .f.
    	voption9 = .f.
    	vSelectAll = .f.
    end if
    If i first click the 'Select all' checkbox, I cannot select the 'Select none' checkbox without first deselecting the 'Select All' checkbox.

    If i first select the 'Select none' checkbox, it allows me to then click the 'Select All' checkbox and unchecks the 'Select none' checkbox as desired.

    What am I missing?

    Thanks

    #2
    Re: Select all/Select none checkbox in dialog

    I'd need to see this in context, or more details, at least. For example, are the "select all" and "select none" controls in separate buttons, or are they two additional choices contained within the checkbox list? I'd favor separate buttons...

    Comment


      #3
      Re: Select all/Select none checkbox in dialog

      Here is how I do it.

      Code:
      dim vall as L
      dim voption_list as C
      dim voption_select as C
      for i = 1 to 11
      	voption_list=voption_list+"option "+(""+i)+crlf()
      next
      
      ui_dlg_box("TEST",<<%dlg%
      {font=arial,10,b}{lf};
      Select all: (vall!evbx_*);;;
      [.23,16voption_select^$$voption_list];
      {lf};
      {sp=5}<Close>
      %dlg%,<<%code%
      if left(a_dlg_button,5)="evbx_"
      	if a_dlg_button="evbx_change"
      		if vall=.t.
      			voption_select=voption_list
      		else
      			voption_select=""
      		end if
      	end if
      a_dlg_button=""
      end if
      %code%)
      Mike W
      __________________________
      "I rebel in at least small things to express to the world that I have not completely surrendered"

      Comment


        #4
        Re: Select all/Select none checkbox in dialog

        Originally posted by Tom Cone Jr View Post
        I'd need to see this in context, or more details, at least. For example, are the "select all" and "select none" controls in separate buttons, or are they two additional choices contained within the checkbox list? I'd favor separate buttons...
        Here's the function I am trying to incorporate this in:

        Code:
        'Date Created: 20-Dec-2019 04:03:36 AM
        'Last Updated: 20-Dec-2019 04:03:36 AM
        'Created By  : Mark
        'Updated By  : Mark
        FUNCTION UploadtoRemote AS V ( )
        '
        DIM vokflag as L = .f.
        DIM vOption1 as L = .t.
        DIM vOption2 as L = .f.
        DIM vOption3 as L = .t.
        DIM vOption4 as L = .t.
        DIM vOption5 as L = .f.
        DIM vOption6 as L = .t.
        DIM vxstartdate as D = date()-365
        DIM vxenddate as D = date()
        DIM flist as C = ""
        DIM vOption7 as L = .t.
        DIM vOption8 as L = .f.
        DIM vOption9 as L = .f.
        DIM vSelectAll as L = .f.
        DIM vSelectNone as L = .f.
        'DIM xdialogStyle as P
        xdialogStyle.color = "#227+227+236"
        xdialogStyle.accentcolor = "White"
        '
        ' Setup header region
        DIM xDlgHeader as P
        xDlgHeader.HeadingText = "Upload Selected Data to Web"
        xDlgHeader.Image = "UploadIcon"
        xDlgHeader.BodyText = <<%str%
        - Information Line #1
        - Information Line #2
        - Information Line #3
        - Information Line #4
        %str%
        '
        dlgtitle = "Upload Files"
        
        varC_result = ui_dlg_box(dlgtitle,<<%dlg%
        {windowstyle=Gradient Horizontal Middle}
        {XdialogTitleSection=65,6xDlgHeader};;;;;
        {region}{font=arial,9,b}
        'adjust the second number below to adjust vertical size of left frame
        {frame=1,10:Data Files}{font=arial,9}
        {sp=2}(vOption1!OKFLAG) Option #1;;;
        {sp=2}(vOption2!OKFLAG) Option #2;
        {sp=2}(vOption3!OKFLAG) Option #3;
        {sp=2}(vOption4!OKFLAG) Option #4;
        {sp=5}(vOption5?vOption4) Option #5;
        'adjust space after first column
        {lf=2};;;;;;;;;
        {sp=4}(vSelectAll!OKFLAG) Select All
        {sp=3}(vSelectNone!OKFLAG) Select None;
        {endregion}{sp=4}
        {region}{font=arial,9,b}
        '{lf=2};
        'adjust frame vertical size for right frame y adjusting second number below
        {frame=1,11:Date Range}{font=arial,9}
        {lf=1};
        {'};
        {sp=2}From: [%DATE;P=popup.calendar(dtoc(vxstartdate));I=popup.calendar%.17vxstartdate!vxstartdate_*?vOption3 .or. vOption4] To: 
        [%DATE;P=popup.calendar(dtoc(vxenddate));I=popup.calendar%.17vxenddate!vxenddate_*?vOption3 .or. vOption4];
        'adjust the spacing after the date range fields
        {lf=1};
        {sp=2}(vOption6!OKFLAG) Option #6;
        {sp=2}(vOption9!OKFLAG) Option #9;
        {sp=2}(vOption8!OKFLAG) Option #8;
        {sp=2}(vOption7!OKFLAG) Option #7;;;;
        {endregion}
        'adjust vertical spacing after columns and before horizontal line
        {lf=1};
        {line=1,0};;;;;
        {font=arial,8}
        <20Upload Data Files!OK?VOKFLAG> <15Cancel!CANCEL>
        %dlg%,<<%code%
        
        If vSelectAll = .t.
        	vOption1 = .t.
        	vOption2 = .t.
        	vOption3 = .t.
        	vOption4 = .t.
        	vOption5 = .t.
        	vOption6 = .t.
        	vOption9 = .t.
        	vOption8 = .t.
        	vOption7 = .t.
        	vSelectNone = .f.
        End If
        If vSelectNone = .t.
        	vOption1 = .f.
        	vOption2 = .f.
        	vOption3 = .f.
        	vOption4 = .f.
        	vOption5 = .f.
        	vOption6 = .f.
        	vOption9 = .f.
        	vOption8 = .f.
        	vOption7 = .f.
        	vSelectAll = .f.
        end if
        
        IF a_dlg_button = "OKFLAG" THEN
        	SELECT
        		CASE vOption1 .and. vOption3 = .f. .and. vOption4 = .f.
        			vOption5 = .f.
        			vokflag = .t.
        		CASE vOption1 = .f. .and. vOption3 = .f. .and. vOption4 = .f. .and. vOption2
        			vOption5 = .f.
        			vokflag = .t.
        		CASE vOption1 .and. vOption3 .and. vOption4 = .f.
        			vOption5 = .f.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE vOption1 .and. vOption3 = .f. .and. vOption4
        			'vOption5 = .t.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE vOption1 .and. vOption3 .and. vOption4
        			'vOption5 = .t.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE vOption1 = .f. .and. vOption3 .and. vOption4
        			'vOption5 = .t.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE vOption1 = .f. .and. vOption3 = .f. .and. vOption4
        			'vOption5 = .t.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE vOption1 = .f. .and. vOption3 .and. vOption4 = .f.
        			vOption5 = .f.
        			IF vxstartdate <> {} .and. vxenddate <> {} THEN
        				vokflag = .t.
        			ELSE
        				vokflag = .f.
        			END IF
        		CASE else
        			vOption5 = .f.
        			vokflag = .f.
        	END SELECT
        	a_dlg_button = ""
        END IF
        
        IF left(a_dlg_button,12) = "vxstartdate_" THEN
        	IF a_dlg_button = "vxstartdate_killfocus" THEN
        		vxstartdate = ctod(dtoc(vxstartdate))
        	END IF
        	a_dlg_button = ""
        	ui_dlg_event(dlgtitle,"OKFLAG")
        END IF
        
        IF left(a_dlg_button,10) = "vxenddate_" THEN
        	IF a_dlg_button = "vxenddate_killfocus" THEN
        		vxenddate = ctod(dtoc(vxenddate))
        	END IF
        	a_dlg_button = ""
        	ui_dlg_event(dlgtitle,"OKFLAG")
        END IF
        
        %code%)
        xbasic_wait_for_idle()
        
        IF varC_result <> "OK" THEN
        	end
        END IF
        
        IF vOption1 THEN
        ' Some code here
        END IF
        
        IF vOption2 THEN
        ' Some code here
        END IF
        
        IF vOption3 THEN
        ' Some code here
        ' Some code here
        END IF
        
        IF vOption4 THEN
        ' Some code here
        END IF
        '
        IF vOption4 .and. vOption5 THEN
        ' Some code here
        END IF
        '
        if vOption9 = .t. then
        ' Some code here
        else
        end if
        '
        if vOption8 = .t. then
        ' Some code here
        end if
        '
        if vOption6 = .t. then
        ' Some code here
        else
        end if
        
        if vOption7 = .t. then
        :a5.close()
        else
        end if
        
        END FUNCTION
        Thanks

        Comment


          #5
          Re: Select all/Select none checkbox in dialog

          Hey Mark,

          The event handlers on the All and None buttons are the same as the Options but you never use them for the same purpose. You need to make them unique like this and it will work:

          Code:
          varC_result = ui_dlg_box(dlgtitle,<<%dlg%
          {windowstyle=Gradient Horizontal Middle}
          {XdialogTitleSection=65,6xDlgHeader};;;;;
          {region}{font=arial,9,b}
          'adjust the second number below to adjust vertical size of left frame
          {frame=1,10:Data Files}{font=arial,9}
          {sp=2}(vOption1!OKFLAG) Option #1;;;
          {sp=2}(vOption2!OKFLAG) Option #2;
          {sp=2}(vOption3!OKFLAG) Option #3;
          {sp=2}(vOption4!OKFLAG) Option #4;
          {sp=5}(vOption5?vOption4) Option #5;
          'adjust space after first column
          {lf=2};;;;;;;;;
          {sp=4}(vSelectAll!ALL) Select All
          {sp=3}(vSelectNone!NONE) Select None;
          {endregion}{sp=4}
          {region}{font=arial,9,b}
          '{lf=2};
          'adjust frame vertical size for right frame y adjusting second number below
          {frame=1,11:Date Range}{font=arial,9}
          {lf=1};
          {'};
          {sp=2}From: [%DATE;P=popup.calendar(dtoc(vxstartdate));I=popup.calendar%.17vxstartdate!vxstartdate_*?vOption3 .or. vOption4] To: 
          [%DATE;P=popup.calendar(dtoc(vxenddate));I=popup.calendar%.17vxenddate!vxenddate_*?vOption3 .or. vOption4];
          'adjust the spacing after the date range fields
          {lf=1};
          {sp=2}(vOption6!OKFLAG) Option #6;
          {sp=2}(vOption9!OKFLAG) Option #9;
          {sp=2}(vOption8!OKFLAG) Option #8;
          {sp=2}(vOption7!OKFLAG) Option #7;;;;
          {endregion}
          'adjust vertical spacing after columns and before horizontal line
          {lf=1};
          {line=1,0};;;;;
          {font=arial,8}
          <20Upload Data Files!OK?VOKFLAG> <15Cancel!CANCEL>
          %dlg%,<<%code%
          
          if a_dlg_button = "ALL"
          	vOption1 = .t.
          	vOption2 = .t.
          	vOption3 = .t.
          	vOption4 = .t.
          	vOption5 = .t.
          	vOption6 = .t.
          	vOption9 = .t.
          	vOption8 = .t.
          	vOption7 = .t.
          	vSelectNone = .f.
          	a_dlg_button = ""
          End If
          If a_dlg_button = "NONE"
          	vOption1 = .f.
          	vOption2 = .f.
          	vOption3 = .f.
          	vOption4 = .f.
          	vOption5 = .f.
          	vOption6 = .f.
          	vOption9 = .f.
          	vOption8 = .f.
          	vOption7 = .f.
          	vSelectAll = .f.
          	a_dlg_button = ""
          end if
          %code%)
          Last edited by Al Buchholz; 12-20-2019, 01:16 PM. Reason: added - %code%) - to coding

          Comment

          Working...
          X