replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Can SCC compiler put up windows, edit boxes etc.?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can SCC compiler put up windows, edit boxes etc.?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sat Nov 24, 2012 7:32 am    Post subject: Can SCC compiler put up windows, edit boxes etc.? Reply with quote

I've been using Windows-type message boxes, edit boxes, buttons etc. with the Silverfrost Ftn95 compilers quite successfully.

Can the SCC C compiler do those things too, in C or C++? While running in either Plato or from a command line?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8261
Location: Salford, UK

PostPosted: Sat Nov 24, 2012 9:45 am    Post subject: Reply with quote

Yes you can use ClearWin+ with SCC but there are a few differences so the FTN95 ClearWin+ documentation is not always sufficient on its own.

There was a manual available at one time but I cannot see it in the Silverfrost downloads.

SDBG and SCION are both written in C/C++ with ClearWin+.

Two points to emphasis. 1) variables in a winio call are passed as pointers and 2) string arguments may need an added length to be passed.

Here is a samples..

Code:
#pragma windows
#include <windows.h>
int cb_opt1()
{
 winio("option 1");
 return 2;
}
int cb_opt2()
{
 winio("option 2");
 return 2;
}
int cb_mouse()
{
  int x,y,f;
  get_mouse_info(x,y,f);
  if(f&2) display_popup_menu();
  return 1;
}

int main()
{
  int mdi;
  winio("%ca[Popup menu test]&");
  winio("%ww[no_border,maximize]&");
  winio("%`bg[grey]%pv%fr%lw",400,200,&mdi);
  winio("%ca[mdi child]%ww[no_border]&");
  winio("%pm[option 1, option 2]&", cb_opt1, cb_opt2);
  winio("%aw%pv%^gr[user_resize,black,full_mouse_input]%ff%nl click here",&mdi,400,400,cb_mouse);
  return 0;
}
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2419
Location: Yateley, Hants, UK

PostPosted: Sat Nov 24, 2012 6:28 pm    Post subject: Reply with quote

Paul,

Quote:
There was a manual available at one time but I cannot see it in the Silverfrost downloads.


Especially as the SCC.HLP and CWPSCC.HLP files are increasingly unreadable, is this a case where the full manual you mention could be found and put on the web? Indeed, if it is not in the Silverfrost archive, is it worth asking long-time users if they have a copy, as in the case of the the FTN77 libraries?

Eddie
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8261
Location: Salford, UK

PostPosted: Sat Nov 24, 2012 7:25 pm    Post subject: Reply with quote

I had forgotten about CWPSCC.HLP and this can still be found in the FTN95.exe folder. This contains everything that was in the old manual.

I don't have the same problem with old .hlp files. Once the driver has been downloaded from the Microsoft website they work OK for me.

For some time I have been aiming to convert the old .hlp files but this takes time even with suitable software to ease the process. For the moment other things are more pressing.
Back to top
View user's profile Send private message AIM Address
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sat Nov 24, 2012 8:02 pm    Post subject: Reply with quote

(oops, duplicate post, sorry)

Last edited by Little-Acorn on Sat Nov 24, 2012 8:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sat Nov 24, 2012 8:02 pm    Post subject: Reply with quote

I have that CWPSCC.HLP file in the directory on my system that holds scc.exe. I just tried looking at it with Microsoft Word, but got gibberish, maybe it's encoded or compressed?

How does one look at it and/or copy/print it?
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Sat Nov 24, 2012 10:02 pm    Post subject: Reply with quote

You need to download and run windows help reader for vista (winhlp32.exe).

Once you have installed this you just double-click on the .HLP file to view it.

Here is the link to it on Microsoft's support, make sure you get the Vista version.

http://support.microsoft.com/kb/917607
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
Little-Acorn



Joined: 06 Jul 2008
Posts: 111
Location: San Diego

PostPosted: Sun Nov 25, 2012 1:03 am    Post subject: Re: Reply with quote

Paul this example works! Thank you - it is invaluable.

Time for a few dumb questions:

1.) The first three "int" statements (and the stuff that comes after them in curly braces) define functions, not classes, correct? And each returns an integer value, correct?

2.) "get_mouse_info(x,y,f)" is a built-in function, correct? Is it a macro found in windows.h ? Most importantly, is it documented anywhere? I couldn't find it in the HELP section for SCC.

3.) What does the statement "#pragma windows" do? Is it documented anywhere?

4.) In the statement that begins 'winio("%aw%pv%^gr', I understand that the '400,400,cb_mouse' defines the width and height of the child graphic window and the callback function. But what does the "&mdi" do?

PaulLaidler wrote:
Yes you can use ClearWin+ with SCC but there are a few differences so the FTN95 ClearWin+ documentation is not always sufficient on its own.

There was a manual available at one time but I cannot see it in the Silverfrost downloads.

SDBG and SCION are both written in C/C++ with ClearWin+.

Two points to emphasis. 1) variables in a winio call are passed as pointers and 2) string arguments may need an added length to be passed.

Here is a samples..

Code:
#pragma windows
#include <windows.h>
int cb_opt1()
{
 winio("option 1");
 return 2;
}
int cb_opt2()
{
 winio("option 2");
 return 2;
}
int cb_mouse()
{
  int x,y,f;
  get_mouse_info(x,y,f);
  if(f&2) display_popup_menu();
  return 1;
}

int main()
{
  int mdi;
  winio("%ca[Popup menu test]&");
  winio("%ww[no_border,maximize]&");
  winio("%`bg[grey]%pv%fr%lw",400,200,&mdi);
  winio("%ca[mdi child]%ww[no_border]&");
  winio("%pm[option 1, option 2]&", cb_opt1, cb_opt2);
  winio("%aw%pv%^gr[user_resize,black,full_mouse_input]%ff%nl click here",&mdi,400,400,cb_mouse);
  return 0;
}


Last edited by Little-Acorn on Sun Nov 25, 2012 1:10 am; edited 1 time in total
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2419
Location: Yateley, Hants, UK

PostPosted: Sun Nov 25, 2012 1:09 am    Post subject: Reply with quote

Once that help reader is installed, SCC.HLP is also readable from Plato. CWPSCC.HLP, however, has to be started separately, and when you do, you are launched into the early days of Clearwin - when it was nowhere near as comprehensive as it is today. The file is also incomplete, as the potentially interesting "National language independence" section isn't there.

It makes an interesting read even for the Fortran programmer.

[Edit] As CWPSCC.HLP is hopelessly out of date, you may also need to read the FTN95 instructions for Clearwin as well, and translate them into the C equivalents.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group