Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

Display Screen Info


Recommended Posts

Hello. I can't seem to find anything about the "Display Screen Info" function in the SDK. I found the "screen_info_type" struct, but none of the options turns the screen axes on. I think the default is the F9 key. I just want to turn these axes on in the same way the F9 key does, but in a chook.

Link to comment
Share on other sites

There is an exported, but non-documented variable controlling that state which is ...

 

DllExport MC_BYTE show_part_info = 0; /* 0=none, 1=F9, 2 = AltF9, 3 = both */

 

Add the above line to your code and then you can set this variable and force a repaint to see the screen update.

 

Or....

 

You can use...

 

post_FT_command ("Mastercam", "OnVPAxesToggle");

 

this will toggle the state just like F9 does.

Link to comment
Share on other sites

I'm sure these lines of code work, I'm also just sure that I don't understand how this code works.

 

First, I copy the line:

 

extern DllImpExp MC_BYTE show_part_info;

 

somewhere above my m_main function. Then inside main I copied in this code:

 

post_FT_command ("Mastercam","OnDisplayInfo");

 

If I need to do more than that, I'm a newbie so forgive my ignorance. If I don't need to do anything else then it's not working. I have included these at the end of m_main:

 

repaint_graphics();

rebuild_graphics();

return MC_NOERROR|MC_UNLOADAPP;

Link to comment
Share on other sites

you have to use DllImpExp, because..

 

//this is for exporting the function from your chook dll

DllExport MC_BYTE show_part_info = 0;

//use the exported function from external dll or exe...

DllImpExp MC_BYTE show_part_info;

 

 

code:

 

if(show_part_info)

{

show_part_info=0;

//you have to repaint

repaint_graphics();

}

 

or,,

if(show_part_info)

{

post_FT_command ("Mastercam","OnDisplayInfo");

//Run a Message Pump if you need it immidialtely...

 

}

 


Link to comment
Share on other sites

In addition to what Takashi says, for pumping mechanism, the following code snippet should work

code:

BOOL PumpMessages( )

{

MSG msg;

//

// Retrieve and dispatch any waiting messages.

//

while (::PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))

{

if (!AfxGetApp()->PumpMessage ())

{

::PostQuitMessage (0);

return FALSE;

}

 

}// end of while (::PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE))

 

 

// Framework's idle processing mechanism.

LONG lIdle = 0;

while (AfxGetApp()->OnIdle (lIdle++));

 

return TRUE;

}

Happy coding!

--Titus

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...