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

calendar in embedded dialog supercontrol

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

    calendar in embedded dialog supercontrol

    I am trying to control where I place an ui_modless xdialog on a form.
    Attached is a sample calendar test
    Forms
    View Calendar and view calendar1 are with supercontrols for the small calendars. The large calendar is with xdialog.
    The forms with supercontrols are about 3 or 4 seconds longer to load than the view active x form.
    I am using activex calendar control 12 for the activex calendars

    Need help:
    In the form activex_test, I am trying to use an embedded supercontrol dialog to show the calendar.
    I cannot get the script make_calendar to run from inside the supercontrol.
    It will build the form, but it will not populate the dates.
    If I can get this to work, then I can control the placement of the calendar on the form.

    Any help would be appreciated.
    Thanks
    Charlie Crimmel

    #2
    Re: calendar in embedded dialog supercontrol

    I played with this for a bit. For some reason the code to run the supercontrol does not see the global function make_month(). I moved the function into a script called make_month_test to make it a local function. I also dimmed calendar as P in the script since it couldn't see it either when run within the supercontrol.

    This is all in a new form called activex_test_new. I also removed the oninit event as well. Please unzip to a seperate directory as I did make some other changes along the way. Hope this helps.
    Jim Coltz
    Alpha Custom Database Solutions, LLC
    A5CustomSolutions.com
    [email protected]

    Comment


      #3
      Re: calendar in embedded dialog supercontrol

      Thanks. But that was about the same thing that I had. The Xdialog comes up and has to be moved by the user.
      I was hoping that the supercontrol embedded x dialog would come up where I had the supercontrol on the form and the user could not move the large calendar.

      i will keep trying

      Comment


        #4
        Re: calendar in embedded dialog supercontrol

        '----------------------------------
        'cannot get the function or script to run from inside the embedded xdialog
        'If I un-comment the line below the calendar form is not rendered.
        'If I keep it commented out the embedded x-dialog is rendered but it will not populate
        'the days of the month.
        'make_month(calendar,date())
        '----------------------------------
        Jim was correct in the code to run the supercontrol does not see the global function make_month().

        Anyone have any other ideas

        Thanks
        Charlie Crimmel

        Comment


          #5
          Re: calendar in embedded dialog supercontrol

          Charlie,

          You can get the make_month() function to run inside the supercontrol's local code by defining the function as a local function in the area where it tells you to dim your variables. I played around with this a bit more today and found I can get the supercontrol to run the make_month and get_daylist functions alright. Add a debug(1) in the locally defined function and you will see they do execute. I just can't figure out why it doesn't "stick" when the code brings up the dialog. I'm guessing it has something to do with the variable namespace but I really don't have the time to dig into it. Lots of other stuff of my own to work through ya know!

          The xdialog supercontrol seems to be a bit different to work with!
          Jim Coltz
          Alpha Custom Database Solutions, LLC
          A5CustomSolutions.com
          [email protected]

          Comment


            #6
            Re: calendar in embedded dialog supercontrol

            Jim:
            I cannot get the drop down month and year to populate.

            Can you post your changes so that I can see how you did this.

            Charlie Crimmel

            Comment


              #7
              Re: calendar in embedded dialog supercontrol

              Originally posted by crimmelcp View Post
              Jim:
              I cannot get the drop down month and year to populate. Can you post your changes so that I can see how you did this.

              Charlie Crimmel
              To make this easier for me to debug I switched to my own calendar that I use in one of my apps and worked to get it working in an embedded Xdialog. I had not tried these embedded Xdialogs yet so I thank you for the challenge as it helped to expand my knowledge a bit. My calendar is also based on the one in Dr. Peter Wayne's book, "Xbasic for Everyone". I've posted the code for it, copied out of the supercontrol definition, below along with a screen shot of the form showing the embedded xdialg in action. Let me know if you need more and I'll give your code a shot again when I get a chance.

              Code:
              'Put code here to DIM any variables used in your Xdialog.
              'dim shared monthlist as c
              'dim shared yearlist as c
              
              monthlist=<<%lst%
              January
              February
              March 
              April
              May
              June 
              July
              August
              September
              October
              November
              December
              %lst%
              
              yearlist=""
              for i=2006 to 2026
              	yearlist=yearlist+i+crlf()
              next 
              
              
              function get_day_list as c (dd as d)	'(day as c, owner as c)
              'function get_day_list as c (dd as c)	'(day as c, owner as c)	this is not using index even though one is created
              	dim tmp as C=""
              	'dim d1 as T = ctodt(day+" 00:00:01")
              	'dim d2 as T = ctodt(day+" 23:59:59")
              		
              	filter = "date_of_apt ="+s_quote(dd) 'date variable
              '	filter = "dtoc(date_of_apt)="+quote(dd) 'string varible		
              	order="time_for_sort"
              '	filter= between_date("date_of_apt",dd,dd) 'this one also works but is slower		
              		
              '	tmp=table.external_record_content_get("appt_time","remspecial(Time_of_Apt)+' '+trim(Type_of_Apt)",order,filter)
              	tmp=table.external_record_content_get("appt_time","(Time_of_Apt)+(Type_of_Apt)",order,filter)
              		
              	'tmp=table.external_record_content_get("caltest","remspecial(Time_of_Apt) +' '+trim(Type_of_Apt)",order,filter)
              	'"'{B=White,Blue}'+time(\"h:0m AM\",datetime)+' '+left(padr(descript,30,' '),30)+'^'+id",\
              	'order,filter)
              	get_day_list=tmp
              end function
               
              function make_month as v(vars as p, start_day as d)
              with vars
              'dim global monthname as c
              'dim global mnth as n
              'dim global curr_month as c
              'dim global curr_year as c
              monthname=cmonth(start_day)+" "+cyear(start_day)
              mnth=month(start_day)
              curr_month=cmonth(start_day)
              curr_year=cyear(start_day)
              
              if day(start_day)>1 then
              	start_day=start_day-day(start_day)+1
              end if
              if dow(start_day)>1 then
              	start_day=start_day-dow(start_day)+1
              end if
              for week=1 to 7 ' rows of calendar
              	for day=0 to 6 ' columns (days of week)
              		dd=start_day+day+((week-1)*7)
              		dayhdr_tmp="{J=L}{B="+if(month(dd)=mnth,"Green","Blue White")+",Blue}"+\
              		day(dd)+"{T=2}|"+cdate(dd)+crlf()
              		daylist_tmp="daylist"+week+dow(dd)+\
              		"=dayhdr_tmp +get_day_list(dd)" 'uses date variable
              		'"=dayhdr_tmp +get_day_list(dtoc(dd))" 'uses string variable much slower
              		evaluate_template(daylist_tmp)
              	next
              next
              end with
              end function
              
              dim shared dlg_expanded as c
              
              dlg_expanded=<<%dlg%
              {comment This next line tells what happens when the X is pressed in the
              upper right hand corner of the dialog box--without it, the dialog won't close!}
              {can_exit=on_exit}
              {comment This is to position the dialog to 0,0 when first opened}
              {position=.000,.000}
              {comment This first region contains the month and year and a some navigational buttons}
              {region}
              {font=Arial,12,B}
              {text=34,2:monthname} 
              {font=Arial,8}
              [curr_month^=monthlist!datechange]|[curr_year^=yearlist!datechange]|
              {sp=1}
              <%B=T;T=Current_Month;O= Current Month%!current_button_click >{sp=2}
              <%B=T;T=Next Month;O= Next Month%!next_month_button_click> {sp=2}
              <%B=T;T=refresh;O= Refresh%!refresh_button_click> {sp=2}
              <%B=T;O={J=C}Rollup {I:'a5_rollup_small'}%!rollup>{sp=2}
              
              {endregion};
              ;
              {comment Writing 'region=a' means that all identically designated regions
              will share the same horizontal tab dimensions.
              This second region contains the day of week header}
              {region=a}
              {font=Arial,8,B}
              Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
              {endregion};
              {comment Each block defines 7 'cells', or one week, containing the dates on
              the first line and appointments on the subsequent lines of the cells.}
              {region=a}
              {font=Arial,6}
              %dlg%
              
              for week=1 to 6
              	for day=1 to 7
              		dlg_expanded=dlg_expanded+\
              		"[%O={@@}%.20,7DL"+week+day+"^#daylist"+week+day+"!daylist]"+if(day=7,";","|")+crlf()	
              	next
              next
              dlg_expanded=dlg_expanded+<<%dlg%
              {endregion};
              %dlg%
              
              
              make_month(local_variables(),date())
              
              	
              'IMPORTANT: Do not change the dialog title.
              ui_modeless_dlg_box(dlgTitle,dlg_expanded,<<%code%
              if a_dlg_button="on_exit" then  'when user presses the X in the upper right corner
                 ui_modeless_dlg_close(dlg_title)
              end if
              %code%)
              Jim Coltz
              Alpha Custom Database Solutions, LLC
              A5CustomSolutions.com
              [email protected]

              Comment

              Working...
              X