Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.49 KB | None | 0 0
  1. {=============================== EmbedWebpage ================================}
  2. (100, 1000, 1000, 100)
  3. (
  4.   Address Text;
  5. )
  6.  
  7. [
  8.   Thumbnail = "Bitmaps\Icons\Globe icon.bmp";
  9.   Title = "Embed Webpage";
  10.  
  11.   BrowserObj;
  12.   Loaded;
  13.   Img;
  14.  
  15.   L; B; R; T;
  16.   W; H;
  17.   Color = "<FFFA1414>";
  18. ]
  19.  
  20. Init [
  21.  
  22.   If 1 Preview;
  23.   [
  24.     UnTransform(Self());
  25.     Img = MakeBitmap(\LibX\FindFile(Thumbnail), 0);
  26.   ]
  27. ]
  28.  
  29. Preview [
  30.  
  31.   If !ParentWindow()\Editing && !\IsDrawMethodPreview() Main;
  32.   [
  33.     Loaded = FALSE;
  34.   ]
  35.  
  36.   L = GetXformRefBox(Self(), 0);
  37.   B = GetXformRefBox(Self(), 1);
  38.   R = GetXformRefBox(Self(), 2);
  39.   T = GetXformRefBox(Self(), 3);
  40.   W = BitmapInfo(Img, 0);
  41.   H = BitmapInfo(Img, 1);
  42.  
  43.   GUIRectangle(0, 1, 1, 0,
  44.                1-L, B, R, 1-T, 1,  0, 0, 1, 0,  0, 0, 0,
  45.                248, -1);
  46.  
  47.   GUIBitmap(0, 1, 1, 0,
  48.             1 - (L+R-W)/2, (T+B+H)/2, (L+R+W)/2, 1 - (T+B-H)/2, 1,
  49.             0, 0, 1, 0,  0, 0, 0,
  50.             Img);
  51. ]
  52.  
  53. Main [
  54.  
  55.   If ParentWindow()\Editing || \IsDrawMethodPreview() Preview;
  56.  
  57.   L = GetXformRefBox(Self(), 0);
  58.   B = GetXformRefBox(Self(), 1);
  59.   R = GetXformRefBox(Self(), 2);
  60.   T = GetXformRefBox(Self(), 3);
  61.  
  62.   If Watch(0, L, B, R, T, Address) Preview;
  63.  
  64.   GUITransform(0, 1, 1, 0,
  65.                1-L, B, R, 1-T, 1,  0, 0, 1, 0,  0, 0, 0,
  66.                BrowserObj = ActiveX(L, B, R, T, "Shell.Explorer"));
  67.  
  68.   If Timeout(Valid(BrowserObj) && !Loaded, 0.1);
  69.   [
  70.     BrowserObj\Navigate(Address);
  71.     Loaded = TRUE;
  72.   ]
  73. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement