Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What is the last letter in the word "SlickEdit":
How many LETTERS are in the following? "a1b2c3":
Which number is missing?  "12345689":

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: chrisant
« on: February 26, 2013, 04:43:29 AM »

I don't see code for allocating a new color, assigning an rgb value to the allocated color, allocating a new scroll markup id, or assigning the allocated color to the allocated scroll markup id.

Here's the basic outline for usage, including the "overhead" calls for allocating everything and setting them up.

Code: [Select]
#if __VERSION__ >= 17
// Declare variables (not static).
int s_colorScrollMarkup = -1;
int s_markertypeScrollMarkup = -1;

// Macro initialization.
definit()
{
   if ( arg( 1 ) != 'L' )
   {
      s_markertypeScrollMarkup = -1;
   }
   else
   {
      if ( s_markertypeScrollMarkup != -1 )
         _ScrollMarkupRemoveAllType( s_markertypeScrollMarkup );
   }
}

// Demand-initialization for colors; can be called repeatedly.
static void EnsureScrollMarkupInitialized()
{
   if ( s_colorScrollMarkup == -1 )
      s_colorScrollMarkup = _AllocColor();
   _default_color( s_colorScrollMarkup, 0, _rgb( 0xcc, 0xbb, 0x00 ), 0 );

   if ( s_markertypeScrollMarkup == -1 )
   {
      s_markertypeScrollMarkup = _ScrollMarkupAllocType();
      _ScrollMarkupSetTypeColor( s_markertypeScrollMarkup, s_colorScrollMarkup );
   }
}

// Sample function...
_command void DoIt() name_info(','VSARG2_READ_ONLY|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
   EnsureScrollMarkupInitialized();
   _ScrollMarkupRemoveAllType( s_markertypeScrollMarkup );

   // HERE IS AN EXAMPLE OF ADDING SCROLL MARKUP.
   // LINE_NUM = starting line number to mark.
   // COUNT_OF_LINES = number of lines to mark.
   _ScrollMarkupAdd( view_id, LINE_NUM, s_markertypeScrollMarkup, COUNT_OF_LINES );
}
#endif
Posted by: pmsteinm
« on: February 25, 2013, 10:56:18 PM »

I'm trying to modify a macro that uses streams to highlight text in various colors to also show these matches on the scroll bar highlight.

I think I need to do this to create what I want:
      int scrollMarkerId = _ScrollMarkupAdd(p_window_id,someLine,markerType,1);
      _ScrollMarkupSetTypeColor(scrollMarkerId,colorId);

But I don't see anything and I don't get any error message.  Is there something else I have to do to make it display that scroll highlights?