VeCAD (VectorCAD) & LiteCAD SDK for programming on BCX & C-lang (NOT OOP)

Started by sergey, December 29, 2012, 01:20:15 PM

Previous topic - Next topic

sergey

timovjl, Thank you for your attention to my non-professional research.
Add these lines to the program.

resource.h
QuoteSTRINGTABLE  \resource.h(265): warning #2099: Missing type specifier
BEGIN  \resource.h(266): error #2001: Syntax error: expected ';' but found 'BEGIN'
IDS_APP_TITLE "LiteCAD-editor2"\resource.h(267): error #2156: Unrecognized declaration
END  \resource.h(270): warning #2099: Missing type specifier

Moved STRINGTABLE to file main.rc
---------------------------------
STRINGTABLE
BEGIN
    IDS_APP_TITLE           "LiteCAD-editor2"
    IDC_TEST02              "TEST02"
END

// Added 18.03.2013 by SNK for ToolBars
STRINGTABLE DISCARDABLE
BEGIN
    CM_SNAP_ENDPOINT "End-point Snap"
    CM_SNAP_MIDPOINT "Mid-point Snap"
    CM_SNAP_CENTER "Center Circle Snap"
    CM_SNAP_POINT "Point or Vertex Snap"
    CM_SNAP_INTER "Intersection Snap"
    CM_SNAP_PERPEND "Perpendicular Snap"
    CM_SNAP_TANGENT "Tangent Snap"
    CM_SNAP_NEAR "Nearest Snap"
    CM_SNAP_QUADRANT "Quadrant Snap"
    CM_SNAP_NONE "None Snap"
    CM_SNAP_DLG "Dialog Snap"
    CM_TOOL_POLAR "Polar Snap"
    CM_TOOL_GRID"Grid Tool"
END

The program compiles, but Tips do not appear.

Topic suggestions I looked in MSDN and other sources.
Added for each icon in the Toolbar TBSTYLE_TOOLTIPS
TBButton(&tbb[0], TD_SNAP_ENDPOINT, CM_SNAP_ENDPOINT, TBSTATE_WRAP | TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_TOOLTIPS);
TBButton(&tbb[1], TD_SNAP_MIDPOINT, CM_SNAP_MIDPOINT, TBSTATE_WRAP | TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_TOOLTIPS);


But it did not help.

He created from one of the tutorials feature WndProc_OnNotify
LRESULT WndProc_OnNotify(HWND hWnd, int idFrom, NMHDR* pnmhdr)
{
  LPTOOLTIPTEXT lpToolTipText;
  LPTBNOTIFY lptbn;
  int nItem;
  static CHAR szBuf[128];

  switch(pnmhdr->code)
  {
    case TTN_NEEDTEXT:
      lpToolTipText = (LPTOOLTIPTEXT)pnmhdr;
      LoadString(hInst, lpToolTipText->hdr.idFrom, szBuf, sizeof(szBuf));
     lpToolTipText->lpszText = szBuf;
      break;

    case TBN_GETBUTTONINFO:
      lptbn = (LPTBNOTIFY)pnmhdr;
      nItem = lptbn->iItem;
      lptbn->tbButton.iBitmap   = tbb[nItem].iBitmap;
      lptbn->tbButton.idCommand = tbb[nItem].idCommand;
      lptbn->tbButton.fsState   = tbb[nItem].fsState;
      lptbn->tbButton.fsStyle   = tbb[nItem].fsStyle;
      lptbn->tbButton.dwData    = tbb[nItem].dwData;
      lptbn->tbButton.iString   = tbb[nItem].iString;

      return ((nItem < sizeof(tbb)/sizeof(tbb[0]))? TRUE : FALSE);
      break;
 
    case TBN_QUERYDELETE:
      lptbn = (LPTBNOTIFY)pnmhdr;
      nItem = lptbn->iItem;
      return (nItem == 0)? FALSE : TRUE;
      break;
   
    case TBN_QUERYINSERT:
      lptbn = (LPTBNOTIFY)pnmhdr;
      nItem = lptbn->iItem;
      return (nItem == 0)? FALSE : TRUE;
      break;
   
    case TBN_TOOLBARCHANGE:
      SendMessage(hwndTb, TB_AUTOSIZE, 0L, 0L);
      return TRUE;
      break;
   
    default:
      break;
  }
  return FALSE;
}

It also does not take ToolTips.
I do not know what else to do.

TimoVJL

Sorry,  stringtable goes to main.rc of course.
I just made those changes to your LiteCADEditor2 and it works in my tests.
Only problem was those duplicate id's.
Remember to add TBSTYLE_TOOLTIPS to window style when you create ToolBar window.
See example.
May the source be with you

TimoVJL

May the source be with you

sergey

I looked at your code, and add this to my code.
It works fine.

Again you helped me. Thank you.

sergey


sergey

Added some geodetic subroutines, see archive inside.
Now can construct Road-profile.
Works only with LiteCAD.dll - see add. archive.