Ejemplo n.º 1
0
 //tab is always at top of page
 void tab(const char *name, int color) 
 {
     if(curdepth != 0) return;
     if(color) tcolor = color;
     tpos++; 
     if(!name) name = intstr(tpos); 
     int w = max(text_width(name) - 2*INSERT, 0);
     if(layoutpass) 
     {  
         ty = max(ty, ysize); 
         ysize = 0;
     }
     else 
     {	
         cury = -ysize;
         int h = FONTH-2*INSERT,
             x1 = curx + tx,
             x2 = x1 + w + ((skinx[3]-skinx[2]) + (skinx[5]-skinx[4]))*SKIN_SCALE,
             y1 = cury - ((skiny[6]-skiny[1])-(skiny[3]-skiny[2]))*SKIN_SCALE-h,
             y2 = cury;
         bool hit = tcurrent && windowhit==this && hitx>=x1 && hity>=y1 && hitx<x2 && hity<y2;
         if(hit && (!guiclicktab || mousebuttons&G3D_DOWN)) 
             *tcurrent = tpos; //roll-over to switch tab
         
         drawskin(x1-skinx[visible()?2:6]*SKIN_SCALE, y1-skiny[1]*SKIN_SCALE, w, h, visible()?10:19, 9, gui2d ? 1 : 2, light, alpha);
         text_(name, x1 + (skinx[3]-skinx[2])*SKIN_SCALE - (w ? INSERT : INSERT/2), y1 + (skiny[2]-skiny[1])*SKIN_SCALE - INSERT, tcolor, visible());
     }
     tx += w + ((skinx[5]-skinx[4]) + (skinx[3]-skinx[2]))*SKIN_SCALE; 
 }
Ejemplo n.º 2
0
SAMPGDK_EXPORT bool SAMPGDK_CALL SetPlayerChatBubble(int playerid, const char *text, long color, float drawdistance, long expiretime) {
    static AMX_NATIVE native = Wrapper::GetInstance()->GetNative("SetPlayerChatBubble");
    FakeAmxHeapObject text_(text);
    cell params[] = {
        5 * 4,
        playerid,
        text_.address(),
        color,
        amx_ftoc(drawdistance),
        expiretime
    };
    return native(&::fakeAmx, params) != 0;
}
Ejemplo n.º 3
0
::CORBA::ValueBase *
MessageImpl::_copy_value (void)
{
  ::CORBA::ValueBase *ret_val= 0;
  ACE_NEW_THROW_EX (
    ret_val,
    MessageImpl (
      user_ (),
      subject_ (),
      text_ ()
    ),
    ::CORBA::NO_MEMORY ()
  );
  return ret_val;
}
Ejemplo n.º 4
0
    void slider(int &val, int vmin, int vmax, int color, char *label)
    {
        autotab();
        int x = curx;
        int y = cury;
        line_(10);
        if(visible())
        {
            if(!label)
            {
                static string s;
                formatstring(s)("%d", val);
                label = s;
            }
            int w = text_width(label);

            bool hit;
            int px, py;
            if(ishorizontal())
            {
                hit = ishit(FONTH, ysize, x, y);
                px = x + (FONTH-w)/2;
                py = y + (ysize-FONTH) - ((ysize-FONTH)*(val-vmin))/((vmax==vmin) ? 1 : (vmax-vmin)); //vmin at bottom
            }
            else
            {
                hit = ishit(xsize, FONTH, x, y);
                px = x + FONTH/2 - w/2 + ((xsize-w)*(val-vmin))/((vmax==vmin) ? 1 : (vmax-vmin)); //vmin at left
                py = y;
            }

            if(hit) color = 0xFF0000;
            text_(label, px, py, color, hit && actionon);
            if(hit && actionon)
            {
                int vnew = (vmin < vmax ? 1 : -1)+vmax-vmin;
                if(ishorizontal()) vnew = int(vnew*(y+ysize-FONTH/2-hity)/(ysize-FONTH));
                else vnew = int(vnew*(hitx-x-FONTH/2)/(xsize-w));
                vnew += vmin;
                vnew = vmin < vmax ? clamp(vnew, vmin, vmax) : clamp(vnew, vmax, vmin);
                if(vnew != val) val = vnew;
            }
        }
    }
Ejemplo n.º 5
0
SAMPGDK_NATIVE(bool, SetObjectMaterialText(int objectid, const char * text, int materialindex, int materialsize, const char * fontface, int fontsize, bool bold, int fontcolor, int backcolor, int textalignment)) {
	static AMX_NATIVE native = sampgdk::Natives::GetNativeWarn("SetObjectMaterialText");
	sampgdk::FakeAmxHeapObject text_(text);
	sampgdk::FakeAmxHeapObject fontface_(fontface);
	cell params[] = {
		10 * sizeof(cell),
		objectid,
		text_.address(),
		materialindex,
		materialsize,
		fontface_.address(),
		fontsize,
		bold,
		fontcolor,
		backcolor,
		textalignment
	};
	return sampgdk::FakeAmx::CallNativeBool(native, params);
}
Ejemplo n.º 6
0
 //tab is always at top of page
 void tab(const char *name, int color) 
 {
     if(curdepth != 0) return;
     if(color) tcolor = color;
     tpos++; 
     if(!name) 
     {
         static string title;
         s_sprintf(title)("%d", tpos);
         name = title;
     }
     int w = text_width(name) - 2*INSERT;
     if(layoutpass) 
     {  
         ty = max(ty, ysize); 
         ysize = 0;
     }
     else 
     {	
         cury = -ysize;
         int h = FONTH-2*INSERT,
             x1 = curx + tx,
             x2 = x1 + w + ((skinx[3]-skinx[2]) + (skinx[5]-skinx[4]))*SKIN_SCALE,
             y1 = cury - ((skiny[5]-skiny[1])-(skiny[3]-skiny[2]))*SKIN_SCALE-h,
             y2 = cury;
         bool hit = tcurrent && windowhit==this && hitx>=x1 && hity>=y1 && hitx<x2 && hity<y2;
         if(hit && (!guiclicktab || mousebuttons&G3D_DOWN)) 
         {	
             *tcurrent = tpos; //roll-over to switch tab
             color = 0xFF0000;
         }
         
         skin_(x1-skinx[visible()?2:6]*SKIN_SCALE, y1-skiny[1]*SKIN_SCALE, w, h, visible()?10:19, 9);
         text_(name, x1 + (skinx[3]-skinx[2])*SKIN_SCALE - INSERT, y1 + (skiny[2]-skiny[1])*SKIN_SCALE - INSERT, tcolor, visible());
     }
     tx += w + ((skinx[5]-skinx[4]) + (skinx[3]-skinx[2]))*SKIN_SCALE; 
 }
Ejemplo n.º 7
0
mdown2::line_p::line_p() : line_p::base_type(line_) {
    line_ = +text_(ph::val(L"*'`$@_[\n")) > qi::eol;
}
Ejemplo n.º 8
0
MessageImpl::MessageImpl (const char *user, const char *subject, const char *text)
{
  user_ (user);
  subject_ (subject);
  text_ (text);
}
Ejemplo n.º 9
0
void
MessageImpl::text (const char *s)
{
  text_ (s);
}
Ejemplo n.º 10
0
char *
MessageImpl::text ()
{
  return CORBA::string_dup (text_ ());
}