home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!wupost!spool.mu.edu!torn!newshub.ccs.yorku.ca!wc8519
- From: wc8519@writer.yorku.ca (Colin Beckmann)
- Subject: Graphics in C C++
- Message-ID: <1992Dec24.162212.12596@newshub.ccs.yorku.ca>
- Sender: news@newshub.ccs.yorku.ca (USENET News System)
- Organization: York University
- Distribution: na
- Date: Thu, 24 Dec 1992 16:22:12 GMT
- Lines: 95
-
- I am trying to learn a little about GUI in C-C++ and have been
- reading two books by James McCord "C Programmers Guide to Graphics" and
- "Borland C++ Programmers Guide to Graphics" The first does not go into
- mice in any form but the second provides a model of a graphical user
- interface. I thought this is **GREAT**. :-). One problem, "it don't
- work,Ma" and I, being a mere lowly apprentice don't know how to fix it. :-(
- Perhaps someone out there can help me with this problem.I am using Borlands
- 3.1 and source code settings are for C++ since I am using BGI graphics .
- Your help is greatly appreciated. Replys can either go to the net or email
- me directly. The solution is probably quite simple and I am going to
- look like the rank amature that I am by if you never ask you'll never know.
- Thanks in advance.
-
-
- The offending code seems to be
-
- /* This function is used to communicate with the mouse */
- /* via interrrupt 0x33h */
-
- void mouse_call (regax, regbx, regcx, regdx)
- {
- union REGS inregs, outregs ;
-
- inregs.x.ax = regax ;
- inregs.x.bx = regbx ;
- inregs.x.cx = regcx ;
- inregs.x.dx = regdx ;
-
- int86 (0x33, &inregs, &outregs) ;
-
- globax = outregs.x.ax ;
- globbx = outregs.x.bx ;
- globcx = outregs.x.cx ;
- globdx = outregs.x.dx ;
- }
-
- which was ment to work with
-
-
- void get_demo_option (void)
- {
- do
- {
- mouse_call (5,0,0,0) ;
- update_pos () ;
- } while (globbx == 0) ;
-
- bar (1,21,638,445) ;
- if (globcx >= 20 && globcx <= 180 && globdx >= 20 && globdx <= 39)
- {
- putimage (100,100, dialog_box, COPY_PUT) ;
- monitor_dialog () ;
- }
-
- if (globcx >= 20 && globcx <= 180 && globdx >= 40 && globdx <= 59)
- {
- putimage (100,100, scroll_bar, COPY_PUT) ;
- monitor_scroll () ;
- }
-
- if (globcx >= 20 && globcx <= 180 && globdx >= 60 && globdx <= 79)
- {
- putimage (100,100, radio_button, COPY_PUT) ;
- monitor_radio () ;
- }
-
- if (globcx >= 20 && globcx <= 180 && globdx >= 80 && globdx <= 99)
- {
- draw_tool () ;
- }
-
- if (globcx >= 20 && globcx <= 180 && globdx >= 100 && globdx <= 120)
- {
- clear_screen () ;
- }
- }
-
- This was to activate part of a pull down menu.
- I know that the old style function def for mouse_call was obsolete and and
- the program would not run. I changed it to
-
- void mouse_call (int regax, int regbx, int regcx, int regdx)
-
- and the program would compile but the clicking the button does not do
- much. The program displays the x y coordinates of the mouse and the mouse
- is where they say it is. The program was apparently written for Borland
- 2.0
- Any help would be appreciated.
- Happy Holidays
-
- Colin
-
- email wc8519@grant.yorku.ca
-
-
-